summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-09-30 21:11:01 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-09-30 21:11:01 +0000
commit3ca8f2e5d5d8cb0551b42ef89deaaadd9c4cb067 (patch)
tree4e443ea37ed9ab1e62c58fb8009fcc51018007c4 /test/Transforms
parentf9dd19f49833e083f8d32ea015d6d5b57be5e4f4 (diff)
downloadllvm-3ca8f2e5d5d8cb0551b42ef89deaaadd9c4cb067.tar.gz
llvm-3ca8f2e5d5d8cb0551b42ef89deaaadd9c4cb067.tar.bz2
llvm-3ca8f2e5d5d8cb0551b42ef89deaaadd9c4cb067.tar.xz
Use right address space size in InstCombineCompares
The test's output doesn't change, but this ensures this is actually hit with a different address space. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/InstCombine/load-cmp.ll18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/load-cmp.ll b/test/Transforms/InstCombine/load-cmp.ll
index 27ee2e3881..98100263b4 100644
--- a/test/Transforms/InstCombine/load-cmp.ll
+++ b/test/Transforms/InstCombine/load-cmp.ll
@@ -1,8 +1,12 @@
; RUN: opt -instcombine -S < %s | FileCheck -check-prefix=NODL %s
-; RUN: opt -instcombine -S -default-data-layout="p:32:32:32-n8:16:32:64" < %s | FileCheck -check-prefix=P32 %s
+; RUN: opt -instcombine -S -default-data-layout="p:32:32:32-p1:16:16:16-n8:16:32:64" < %s | FileCheck -check-prefix=P32 %s
@G16 = internal constant [10 x i16] [i16 35, i16 82, i16 69, i16 81, i16 85,
i16 73, i16 82, i16 69, i16 68, i16 0]
+
+@G16_as1 = internal addrspace(1) constant [10 x i16] [i16 35, i16 82, i16 69, i16 81, i16 85,
+ i16 73, i16 82, i16 69, i16 68, i16 0]
+
@GD = internal constant [6 x double]
[double -10.0, double 1.0, double 4.0, double 2.0, double -20.0, double -40.0]
@@ -56,6 +60,18 @@ define i1 @test1_noinbounds_i64(i64 %X) {
; P32-NEXT: ret i1 %R
}
+define i1 @test1_noinbounds_as1(i32 %x) {
+ %p = getelementptr [10 x i16] addrspace(1)* @G16_as1, i16 0, i32 %x
+ %q = load i16 addrspace(1)* %p
+ %r = icmp eq i16 %q, 0
+ ret i1 %r
+
+; P32-LABEL: @test1_noinbounds_as1(
+; P32-NEXT: trunc i32 %x to i16
+; P32-NEXT: %r = icmp eq i16 %1, 9
+; P32-NEXT: ret i1 %r
+}
+
define i1 @test2(i32 %X) {
%P = getelementptr inbounds [10 x i16]* @G16, i32 0, i32 %X
%Q = load i16* %P