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 --check-prefix=CHECK-DATA 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: _Z3fooILi1EEvi: 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, 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 call void @_Z3bari( i32 0 ) 59 br label %bb1 60 61bb1: ; preds = %bb, %entry 62 call void @_Z3bari( i32 1 ) 63 br label %bb2 64 65bb2: ; preds = %bb1, %entry 66 call void @_Z3bari( i32 2 ) 67 br label %bb11 68 69bb3: ; preds = %entry 70 br label %bb4 71 72bb4: ; preds = %bb3, %entry 73 br label %bb5 74 75bb5: ; preds = %bb4, %entry 76 br label %bb6 77 78bb6: ; preds = %bb5, %entry 79 call void @_Z3bari( i32 2 ) 80 br label %bb11 81 82bb7: ; preds = %entry 83 br label %bb8 84 85bb8: ; preds = %bb7, %entry 86 br label %bb9 87 88bb9: ; preds = %bb8, %entry 89 call void @_Z3bari( i32 3 ) 90 br label %bb11 91 92bb10: ; preds = %entry 93 br label %bb11 94 95bb11: ; preds = %bb10, %bb9, %bb6, %bb2 96 br label %return 97 98return: ; preds = %bb11 99 ret void 100} 101