aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-01 04:24:20 +0000
committerChris Lattner <sabre@nondot.org>2002-02-01 04:24:20 +0000
commit04dcb5c4fc0c61b60d6099509657b52097a9a117 (patch)
treee101d353b0ca5af78d15274ef8e5d9351a69b037 /test
parentc0cbbcf16931d4dd9c4843823fc5c675436ff2c2 (diff)
downloadexternal_llvm-04dcb5c4fc0c61b60d6099509657b52097a9a117.zip
external_llvm-04dcb5c4fc0c61b60d6099509657b52097a9a117.tar.gz
external_llvm-04dcb5c4fc0c61b60d6099509657b52097a9a117.tar.bz2
Initial checkin of 'Other' section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1621 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Other/2002-01-31-PostDomSet.ll54
-rw-r--r--test/Other/Makefile10
2 files changed, 64 insertions, 0 deletions
diff --git a/test/Other/2002-01-31-PostDomSet.ll b/test/Other/2002-01-31-PostDomSet.ll
new file mode 100644
index 0000000..b83bd66
--- /dev/null
+++ b/test/Other/2002-01-31-PostDomSet.ll
@@ -0,0 +1,54 @@
+; Crash in post dominator set construction.
+;
+; RUN: analyze -postdomset %s
+;
+
+implementation
+
+int "looptest"(int %i, int %j)
+begin
+ %whichLoop = setlt int %i, %j
+ br bool %whichLoop, label %Loop1Header, label %Loop2Header
+
+Loop1Header:
+ %i1 = add int 0, 0 ; %i1 = 0
+ br label %L1Top
+L1Top:
+ %i2 = phi int [%i1, %Loop1Header], [%i3, %L1Body]
+ %L1Done = seteq int %i2, %j
+ br bool %L1Done, label %L1End, label %L1Body
+L1Body:
+ %i3 = add int %i2, 2
+ br label %L1Top
+L1End:
+ %v0 = add int %i2, %j ; %v0 = 3 * %j
+ br label %Merge
+
+Loop2Header:
+ %m1 = add int 0, 0
+ %k1 = add int 0, %i
+ br label %L2Top
+L2Top:
+ %k2 = phi int [%k1, %Loop2Header], [%k3, %L2Body]
+ %m2 = phi int [%m1, %Loop2Header], [%m3, %L2Body]
+ %L2Done = seteq int %k2, 0
+ br bool %L2Done, label %L2End, label %L2Body
+L2Body:
+ %k3 = sub int %k2, 1
+ %m3 = add int %m2, %j
+ br label %L2Top
+L2End:
+ %v1 = add int %m2, %k2
+ br label %Merge
+
+Merge:
+ %v2 = phi int [%v0, %L1End], [%v1, %L2End]
+ ret int %v2
+end
+
+int "main"()
+begin
+ call int %looptest(int 0, int 12)
+ ret int %0
+end
+
diff --git a/test/Other/Makefile b/test/Other/Makefile
new file mode 100644
index 0000000..520a58a
--- /dev/null
+++ b/test/Other/Makefile
@@ -0,0 +1,10 @@
+
+LEVEL = ../../..
+include $(LEVEL)/test/Makefile.tests
+
+TESTS := $(wildcard *.ll)
+
+all:: $(addprefix Output/, $(TESTS:%.ll=%.ll.out))
+
+Output/%.ll.out: %.ll Output/.dir
+ -$(TESTRUNR) $<