new tests
authorChris Lattner <sabre@nondot.org>
Sun, 31 Aug 2003 02:38:46 +0000 (02:38 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 31 Aug 2003 02:38:46 +0000 (02:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8249 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/PruneEH/Makefile [new file with mode: 0644]
test/Transforms/PruneEH/recursivetest.llx [new file with mode: 0644]
test/Transforms/PruneEH/simpletest.llx [new file with mode: 0644]

diff --git a/test/Transforms/PruneEH/Makefile b/test/Transforms/PruneEH/Makefile
new file mode 100644 (file)
index 0000000..e92df45
--- /dev/null
@@ -0,0 +1,10 @@
+
+LEVEL = ../../../..
+include $(LEVEL)/test/Makefile.tests
+
+TESTS := $(wildcard *.llx)
+
+all:: $(addprefix Output/, $(TESTS:%.llx=%.llx.out))
+
+Output/%.llx.out: %.llx Output/.dir $(LOPT)
+       -$(TESTRUNR) $<
diff --git a/test/Transforms/PruneEH/recursivetest.llx b/test/Transforms/PruneEH/recursivetest.llx
new file mode 100644 (file)
index 0000000..8a966bb
--- /dev/null
@@ -0,0 +1,19 @@
+; RUN: as < %s | opt -prune-eh | dis | not grep invoke
+
+implementation
+
+internal int %foo() {
+       invoke int %foo() to label %Normal except label %Except
+Normal:
+       ret int 12
+Except:
+       ret int 123
+}
+
+int %caller() {
+       invoke int %foo() to label %Normal except label %Except
+Normal:
+       ret int 0
+Except:
+       ret int 1
+}
diff --git a/test/Transforms/PruneEH/simpletest.llx b/test/Transforms/PruneEH/simpletest.llx
new file mode 100644 (file)
index 0000000..619ca48
--- /dev/null
@@ -0,0 +1,15 @@
+; RUN: as < %s | opt -prune-eh | dis | not grep invoke
+
+implementation
+
+internal void %foo() {
+       ret void            ; does not throw
+}
+
+int %caller() {
+       invoke void %foo() to label %Normal except label %Except
+Normal:
+       ret int 0
+Except:
+       ret int 1
+}