Initial checkin of 'Other' section
authorChris Lattner <sabre@nondot.org>
Fri, 1 Feb 2002 04:24:20 +0000 (04:24 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 1 Feb 2002 04:24:20 +0000 (04:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1621 91177308-0d34-0410-b5e6-96231b3b80d8

test/Other/2002-01-31-PostDomSet.ll [new file with mode: 0644]
test/Other/Makefile [new file with mode: 0644]

diff --git a/test/Other/2002-01-31-PostDomSet.ll b/test/Other/2002-01-31-PostDomSet.ll
new file mode 100644 (file)
index 0000000..b83bd66
--- /dev/null
@@ -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 (file)
index 0000000..520a58a
--- /dev/null
@@ -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) $<