1; RUN: llc < %s -relocation-model=pic -mtriple=i386-linux-gnu -asm-verbose=false \ 2; RUN: | FileCheck %s --check-prefix=CHECK-LINUX 3; RUN: llc < %s -relocation-model=pic -mark-data-regions -mtriple=i686-apple-darwin -asm-verbose=false \ 4; RUN: | FileCheck %s --check-prefix=CHECK-DATA 5; RUN: llc < %s -relocation-model=pic -mtriple=i686-apple-darwin -asm-verbose=false \ 6; RUN: | FileCheck %s 7; RUN: llc < %s -mtriple=x86_64-apple-darwin | not grep 'lJTI' 8; rdar://6971437 9; rdar://7738756 10 11declare void @_Z3bari(i32) 12 13; CHECK-LINUX: .text._Z3fooILi1EEvi,"axG",@progbits,_Z3fooILi1EEvi,comdat 14define linkonce void @_Z3fooILi1EEvi(i32 %Y) nounwind { 15entry: 16; CHECK: L0$pb 17; CHECK-NOT: leal 18; CHECK: Ltmp0 = LJTI0_0-L0$pb 19; CHECK-NEXT: addl Ltmp0(%eax,%ecx,4) 20; CHECK-NEXT: jmpl *%eax 21 22;; When data-in-code markers are enabled, we should see them around the jump 23;; table. 24; CHECK-DATA: .data_region jt32 25; CHECK-DATA: LJTI0_0 26; CHECK-DATA: .end_data_region 27 28;; When they're not enabled, make sure we don't see them at all. 29; CHECK-NOT: .data_region 30; CHECK-LINUX-NOT: .data_region 31 %Y_addr = alloca i32 ; <i32*> [#uses=2] 32 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] 33 store i32 %Y, i32* %Y_addr 34 %tmp = load i32* %Y_addr ; <i32> [#uses=1] 35 switch i32 %tmp, label %bb10 [ 36 i32 0, label %bb3 37 i32 1, label %bb 38 i32 2, label %bb 39 i32 3, label %bb 40 i32 4, label %bb 41 i32 5, label %bb 42 i32 6, label %bb 43 i32 7, label %bb 44 i32 8, label %bb 45 i32 9, label %bb 46 i32 10, label %bb 47 i32 12, label %bb1 48 i32 13, label %bb5 49 i32 14, label %bb6 50 i32 16, label %bb2 51 i32 17, label %bb4 52 i32 23, label %bb8 53 i32 27, label %bb7 54 i32 34, label %bb9 55 ] 56 57bb: ; preds = %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry 58 br label %bb1 59 60bb1: ; preds = %bb, %entry 61 br label %bb2 62 63bb2: ; preds = %bb1, %entry 64 call void @_Z3bari( i32 1 ) 65 br label %bb11 66 67bb3: ; preds = %entry 68 br label %bb4 69 70bb4: ; preds = %bb3, %entry 71 br label %bb5 72 73bb5: ; preds = %bb4, %entry 74 br label %bb6 75 76bb6: ; preds = %bb5, %entry 77 call void @_Z3bari( i32 2 ) 78 br label %bb11 79 80bb7: ; preds = %entry 81 br label %bb8 82 83bb8: ; preds = %bb7, %entry 84 br label %bb9 85 86bb9: ; preds = %bb8, %entry 87 call void @_Z3bari( i32 3 ) 88 br label %bb11 89 90bb10: ; preds = %entry 91 br label %bb11 92 93bb11: ; preds = %bb10, %bb9, %bb6, %bb2 94 br label %return 95 96return: ; preds = %bb11 97 ret void 98} 99