X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FCodeGen%2FX86%2Fpic_jumptable.ll;h=8c1992a24ece5ef4672e4eaf2773f37b095ceb15;hb=b5b07c36862e772571fcbfa459fa9780615ec42b;hp=1731feb58e91d29239746eeb06c63533024f62a3;hpb=42bf74be1402df7409efbea089310d4c276fde37;p=oota-llvm.git diff --git a/test/CodeGen/X86/pic_jumptable.ll b/test/CodeGen/X86/pic_jumptable.ll index 1731feb58e9..8c1992a24ec 100644 --- a/test/CodeGen/X86/pic_jumptable.ll +++ b/test/CodeGen/X86/pic_jumptable.ll @@ -1,15 +1,37 @@ -; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i386-linux-gnu -asm-verbose=false | not grep -F .text -; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin -asm-verbose=false | not grep lea -; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin -asm-verbose=false | grep add | count 2 +; RUN: llc < %s -relocation-model=pic -mtriple=i386-linux-gnu -asm-verbose=false \ +; RUN: | FileCheck %s --check-prefix=CHECK-LINUX +; RUN: llc < %s -relocation-model=pic -mark-data-regions -mtriple=i686-apple-darwin -asm-verbose=false \ +; RUN: | FileCheck %s --check-prefix=CHECK-DATA +; RUN: llc < %s -relocation-model=pic -mtriple=i686-apple-darwin -asm-verbose=false \ +; RUN: | FileCheck %s +; RUN: llc < %s -mtriple=x86_64-apple-darwin | not grep 'lJTI' +; rdar://6971437 +; rdar://7738756 declare void @_Z3bari(i32) -define linkonce void @_Z3fooILi1EEvi(i32 %Y) { +; CHECK-LINUX: _Z3fooILi1EEvi: +define linkonce void @_Z3fooILi1EEvi(i32 %Y) nounwind { entry: +; CHECK: L0$pb +; CHECK-NOT: leal +; CHECK: Ltmp0 = LJTI0_0-L0$pb +; CHECK-NEXT: addl Ltmp0(%eax,%ecx,4) +; CHECK-NEXT: jmpl *%eax + +;; When data-in-code markers are enabled, we should see them around the jump +;; table. +; CHECK-DATA: .data_region jt32 +; CHECK-DATA: LJTI0_0 +; CHECK-DATA: .end_data_region + +;; When they're not enabled, make sure we don't see them at all. +; CHECK-NOT: .data_region +; CHECK-LINUX-NOT: .data_region %Y_addr = alloca i32 ; [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] store i32 %Y, i32* %Y_addr - %tmp = load i32* %Y_addr ; [#uses=1] + %tmp = load i32, i32* %Y_addr ; [#uses=1] switch i32 %tmp, label %bb10 [ i32 0, label %bb3 i32 1, label %bb @@ -33,13 +55,15 @@ entry: ] bb: ; preds = %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry + call void @_Z3bari( i32 0 ) br label %bb1 bb1: ; preds = %bb, %entry + call void @_Z3bari( i32 1 ) br label %bb2 bb2: ; preds = %bb1, %entry - call void @_Z3bari( i32 1 ) + call void @_Z3bari( i32 2 ) br label %bb11 bb3: ; preds = %entry