From 04dcb5c4fc0c61b60d6099509657b52097a9a117 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 1 Feb 2002 04:24:20 +0000 Subject: [PATCH] Initial checkin of 'Other' section git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1621 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Other/2002-01-31-PostDomSet.ll | 54 +++++++++++++++++++++++++++++ test/Other/Makefile | 10 ++++++ 2 files changed, 64 insertions(+) create mode 100644 test/Other/2002-01-31-PostDomSet.ll create mode 100644 test/Other/Makefile diff --git a/test/Other/2002-01-31-PostDomSet.ll b/test/Other/2002-01-31-PostDomSet.ll new file mode 100644 index 00000000000..b83bd66731b --- /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 00000000000..520a58a57fb --- /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) $<