summaryrefslogtreecommitdiff
path: root/test/CodeGen/Generic/switch-crit-edge-constant.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-10-28 17:04:16 +0000
committerChris Lattner <sabre@nondot.org>2006-10-28 17:04:16 +0000
commit49bb78ce9fe79640f2cd8f8cfaf7874552fed29d (patch)
treeca92bed060b21ed96b42e09f927c8064ef69bdee /test/CodeGen/Generic/switch-crit-edge-constant.ll
parentb57de3328d3826e1f270f3a38256ff67aaec1871 (diff)
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Generic/switch-crit-edge-constant.ll')
-rw-r--r--test/CodeGen/Generic/switch-crit-edge-constant.ll55
1 files changed, 55 insertions, 0 deletions
diff --git a/test/CodeGen/Generic/switch-crit-edge-constant.ll b/test/CodeGen/Generic/switch-crit-edge-constant.ll
new file mode 100644
index 00000000000..460354e9b93
--- /dev/null
+++ b/test/CodeGen/Generic/switch-crit-edge-constant.ll
@@ -0,0 +1,55 @@
+; RUN: llvm-as < %s | llc -march=x86 &&
+; RUN: llvm-as < %s | llc -march=x86 | grep 'mov.*str1' | wc -l | grep 1
+; PR925
+
+target endian = little
+target pointersize = 32
+target triple = "i686-apple-darwin8.7.2"
+%str1 = internal constant [5 x sbyte] c"bonk\00" ; <[5 x sbyte]*> [#uses=1]
+%str2 = internal constant [5 x sbyte] c"bork\00" ; <[5 x sbyte]*> [#uses=1]
+%str = internal constant [8 x sbyte] c"perfwap\00" ; <[8 x sbyte]*> [#uses=1]
+
+implementation ; Functions:
+
+void %foo(int %C) {
+entry:
+ switch int %C, label %bb2 [
+ int 1, label %blahaha
+ int 2, label %blahaha
+ int 3, label %blahaha
+ int 4, label %blahaha
+ int 5, label %blahaha
+ int 6, label %blahaha
+ int 7, label %blahaha
+ int 8, label %blahaha
+ int 9, label %blahaha
+ int 10, label %blahaha
+ ]
+
+bb2: ; preds = %entry
+ %tmp5 = and int %C, 123 ; <int> [#uses=1]
+ %tmp = seteq int %tmp5, 0 ; <bool> [#uses=1]
+ br bool %tmp, label %blahaha, label %cond_true
+
+cond_true: ; preds = %bb2
+ br label %blahaha
+
+blahaha: ; preds = %cond_true, %bb2, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry
+ %s.0 = phi sbyte* [ getelementptr ([8 x sbyte]* %str, int 0, uint 0), %cond_true ], [ getelementptr ([5 x sbyte]* %str1, int 0, uint 0), %entry ], [ getelementptr ([5 x sbyte]* %str1, int 0, uint 0), %entry ], [ getelementptr ([5 x sbyte]* %str1, int 0, uint 0), %entry ], [ getelementptr ([5 x sbyte]* %str1, int 0, uint 0), %entry ], [ getelementptr ([5 x sbyte]* %str1, int 0, uint 0), %entry ], [ getelementptr ([5 x sbyte]* %str1, int 0, uint 0), %entry ], [ getelementptr ([5 x sbyte]* %str1, int 0, uint 0), %entry ], [ getelementptr ([5 x sbyte]* %str1, int 0, uint 0), %entry ], [ getelementptr ([5 x sbyte]* %str1, int 0, uint 0), %entry ], [ getelementptr ([5 x sbyte]* %str1, int 0, uint 0), %entry ], [ getelementptr ([5 x sbyte]* %str2, int 0, uint 0), %bb2 ] ; <sbyte*> [#uses=13]
+ %tmp8 = tail call int (sbyte*, ...)* %printf( sbyte* %s.0 ) ; <int> [#uses=0]
+ %tmp10 = tail call int (sbyte*, ...)* %printf( sbyte* %s.0 ) ; <int> [#uses=0]
+ %tmp12 = tail call int (sbyte*, ...)* %printf( sbyte* %s.0 ) ; <int> [#uses=0]
+ %tmp14 = tail call int (sbyte*, ...)* %printf( sbyte* %s.0 ) ; <int> [#uses=0]
+ %tmp16 = tail call int (sbyte*, ...)* %printf( sbyte* %s.0 ) ; <int> [#uses=0]
+ %tmp18 = tail call int (sbyte*, ...)* %printf( sbyte* %s.0 ) ; <int> [#uses=0]
+ %tmp20 = tail call int (sbyte*, ...)* %printf( sbyte* %s.0 ) ; <int> [#uses=0]
+ %tmp22 = tail call int (sbyte*, ...)* %printf( sbyte* %s.0 ) ; <int> [#uses=0]
+ %tmp24 = tail call int (sbyte*, ...)* %printf( sbyte* %s.0 ) ; <int> [#uses=0]
+ %tmp26 = tail call int (sbyte*, ...)* %printf( sbyte* %s.0 ) ; <int> [#uses=0]
+ %tmp28 = tail call int (sbyte*, ...)* %printf( sbyte* %s.0 ) ; <int> [#uses=0]
+ %tmp30 = tail call int (sbyte*, ...)* %printf( sbyte* %s.0 ) ; <int> [#uses=0]
+ %tmp32 = tail call int (sbyte*, ...)* %printf( sbyte* %s.0 ) ; <int> [#uses=0]
+ ret void
+}
+
+declare int %printf(sbyte*, ...)