summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SimplifyCFG/switch_create.ll
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-10-21 18:55:08 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-10-21 18:55:08 +0000
commitfa64659bd8025db9c1a6e010ff6a0982aaf43eb0 (patch)
tree81f3685186f98db26c2e3aebbe11afeb9b40863e /llvm/test/Transforms/SimplifyCFG/switch_create.ll
parent2a1c07a5fb6439a98919ac14c686f5eb837a98f2 (diff)
downloadbcm5719-llvm-fa64659bd8025db9c1a6e010ff6a0982aaf43eb0.tar.gz
bcm5719-llvm-fa64659bd8025db9c1a6e010ff6a0982aaf43eb0.zip
Teach SimplifyCFG about address spaces
llvm-svn: 193104
Diffstat (limited to 'llvm/test/Transforms/SimplifyCFG/switch_create.ll')
-rw-r--r--llvm/test/Transforms/SimplifyCFG/switch_create.ll21
1 files changed, 20 insertions, 1 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/switch_create.ll b/llvm/test/Transforms/SimplifyCFG/switch_create.ll
index fe20f17eed4..caacf7e40f5 100644
--- a/llvm/test/Transforms/SimplifyCFG/switch_create.ll
+++ b/llvm/test/Transforms/SimplifyCFG/switch_create.ll
@@ -1,5 +1,5 @@
; RUN: opt -S -simplifycfg < %s | FileCheck -check-prefix=CHECK %s
-; RUN: opt -S -default-data-layout="p:32:32" -simplifycfg < %s | FileCheck -check-prefix=DL %s
+; RUN: opt -S -default-data-layout="p:32:32-p1:16:16" -simplifycfg < %s | FileCheck -check-prefix=DL %s
; TODO: Other tests should also have check lines with datalayout
@@ -44,6 +44,25 @@ F: ; preds = %0
; DL: ]
}
+define void @test1_ptr_as1(i32 addrspace(1)* %V) {
+ %C1 = icmp eq i32 addrspace(1)* %V, inttoptr (i32 4 to i32 addrspace(1)*)
+ %C2 = icmp eq i32 addrspace(1)* %V, inttoptr (i32 17 to i32 addrspace(1)*)
+ %CN = or i1 %C1, %C2 ; <i1> [#uses=1]
+ br i1 %CN, label %T, label %F
+T: ; preds = %0
+ call void @foo1( )
+ ret void
+F: ; preds = %0
+ call void @foo2( )
+ ret void
+; DL-LABEL: @test1_ptr_as1(
+; DL: %magicptr = ptrtoint i32 addrspace(1)* %V to i16
+; DL: switch i16 %magicptr, label %F [
+; DL: i16 17, label %T
+; DL: i16 4, label %T
+; DL: ]
+}
+
define void @test2(i32 %V) {
%C1 = icmp ne i32 %V, 4 ; <i1> [#uses=1]
%C2 = icmp ne i32 %V, 17 ; <i1> [#uses=1]
OpenPOWER on IntegriCloud