diff options
Diffstat (limited to 'test/Other')
-rw-r--r-- | test/Other/X86/lit.local.cfg | 3 | ||||
-rw-r--r-- | test/Other/constant-fold-gep.ll | 19 | ||||
-rw-r--r-- | test/Other/llvm-nm-without-aliases.ll | 4 |
3 files changed, 21 insertions, 5 deletions
diff --git a/test/Other/X86/lit.local.cfg b/test/Other/X86/lit.local.cfg index ba763cf..e71f3cc 100644 --- a/test/Other/X86/lit.local.cfg +++ b/test/Other/X86/lit.local.cfg @@ -1,4 +1,3 @@ -targets = set(config.root.targets_to_build.split()) -if not 'X86' in targets: +if not 'X86' in config.root.targets: config.unsupported = True diff --git a/test/Other/constant-fold-gep.ll b/test/Other/constant-fold-gep.ll index aed4145..3874898 100644 --- a/test/Other/constant-fold-gep.ll +++ b/test/Other/constant-fold-gep.ll @@ -457,7 +457,7 @@ define i8* @different_addrspace() nounwind noinline { %p = getelementptr inbounds i8* addrspacecast ([4 x i8] addrspace(12)* @p12 to i8*), i32 2 ret i8* %p -; OPT: ret i8* getelementptr (i8* addrspacecast ([4 x i8] addrspace(12)* @p12 to i8*), i32 2) +; OPT: ret i8* getelementptr (i8* addrspacecast (i8 addrspace(12)* getelementptr inbounds ([4 x i8] addrspace(12)* @p12, i32 0, i32 0) to i8*), i32 2) } define i8* @same_addrspace() nounwind noinline { @@ -467,4 +467,21 @@ define i8* @same_addrspace() nounwind noinline { ; OPT: ret i8* getelementptr inbounds ([4 x i8]* @p0, i32 0, i32 2) } +@gv1 = internal global i32 1 +@gv2 = internal global [1 x i32] [ i32 2 ] +@gv3 = internal global [1 x i32] [ i32 2 ] + +; Handled by TI-independent constant folder +define i1 @gv_gep_vs_gv() { + ret i1 icmp eq (i32* getelementptr inbounds ([1 x i32]* @gv2, i32 0, i32 0), i32* @gv1) +} +; PLAIN: gv_gep_vs_gv +; PLAIN: ret i1 false + +define i1 @gv_gep_vs_gv_gep() { + ret i1 icmp eq (i32* getelementptr inbounds ([1 x i32]* @gv2, i32 0, i32 0), i32* getelementptr inbounds ([1 x i32]* @gv3, i32 0, i32 0)) +} +; PLAIN: gv_gep_vs_gv_gep +; PLAIN: ret i1 false + ; CHECK: attributes #0 = { nounwind } diff --git a/test/Other/llvm-nm-without-aliases.ll b/test/Other/llvm-nm-without-aliases.ll index 9d9408c..6ef72c7 100644 --- a/test/Other/llvm-nm-without-aliases.ll +++ b/test/Other/llvm-nm-without-aliases.ll @@ -1,6 +1,6 @@ ; RUN: llvm-as < %s > %t -; RUN: llvm-nm -without-aliases < %t | FileCheck %s -; RUN: llvm-nm < %t | FileCheck --check-prefix=WITH %s +; RUN: llvm-nm -without-aliases - < %t | FileCheck %s +; RUN: llvm-nm - < %t | FileCheck --check-prefix=WITH %s ; CHECK-NOT: T a0bar ; CHECK-NOT: T a0foo |