summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/C++Frontend/2003-06-08-BaseType.cpp17
-rw-r--r--test/C++Frontend/2003-06-08-VirtualFunctions.cpp23
-rw-r--r--test/C++Frontend/2003-06-13-Crasher.cpp8
-rw-r--r--test/CBackend/2003-06-11-HexConstant.ll3
-rw-r--r--test/CBackend/2003-06-11-LiteralStringProblem.ll3
-rw-r--r--test/CodeGen/CBackend/2003-06-11-HexConstant.ll3
-rw-r--r--test/CodeGen/CBackend/2003-06-11-LiteralStringProblem.ll3
-rw-r--r--test/Transforms/ADCE/2003-06-11-InvalidCFG.ll28
-rw-r--r--test/Transforms/DSAnalysis/physicalsubtype.ll14
-rw-r--r--test/Transforms/DeadArgElim/Makefile10
-rw-r--r--test/Transforms/DeadArgElim/basictest.ll27
-rw-r--r--test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll14
12 files changed, 153 insertions, 0 deletions
diff --git a/test/C++Frontend/2003-06-08-BaseType.cpp b/test/C++Frontend/2003-06-08-BaseType.cpp
new file mode 100644
index 0000000..b78af2a
--- /dev/null
+++ b/test/C++Frontend/2003-06-08-BaseType.cpp
@@ -0,0 +1,17 @@
+
+
+struct foo {
+ int y;
+ foo();
+};
+
+struct bar : public foo {
+ //int x;
+ bar();
+};
+
+//int bar::X() { return 0; }
+
+bar::bar() {
+
+}
diff --git a/test/C++Frontend/2003-06-08-VirtualFunctions.cpp b/test/C++Frontend/2003-06-08-VirtualFunctions.cpp
new file mode 100644
index 0000000..ea32e19
--- /dev/null
+++ b/test/C++Frontend/2003-06-08-VirtualFunctions.cpp
@@ -0,0 +1,23 @@
+
+
+struct foo {
+ int y;
+ foo();
+ virtual int T() = 0;
+};
+
+struct bar : public foo {
+ //int x;
+ bar();
+ int T() {}
+};
+
+//int bar::X() { return 0; }
+
+foo::foo() : y(4) {
+
+}
+
+bar::bar() {
+
+}
diff --git a/test/C++Frontend/2003-06-13-Crasher.cpp b/test/C++Frontend/2003-06-13-Crasher.cpp
new file mode 100644
index 0000000..be581dd
--- /dev/null
+++ b/test/C++Frontend/2003-06-13-Crasher.cpp
@@ -0,0 +1,8 @@
+void bar();
+
+void foo() {
+ struct TEST {
+ ~TEST() { bar(); }
+ } TESTOBJ;
+
+}
diff --git a/test/CBackend/2003-06-11-HexConstant.ll b/test/CBackend/2003-06-11-HexConstant.ll
new file mode 100644
index 0000000..31bbf88
--- /dev/null
+++ b/test/CBackend/2003-06-11-HexConstant.ll
@@ -0,0 +1,3 @@
+; Make sure hex constant does not continue into a valid hexadecimal letter/number
+%version = global [3 x sbyte] c"\001\00"
+
diff --git a/test/CBackend/2003-06-11-LiteralStringProblem.ll b/test/CBackend/2003-06-11-LiteralStringProblem.ll
new file mode 100644
index 0000000..80d8aea
--- /dev/null
+++ b/test/CBackend/2003-06-11-LiteralStringProblem.ll
@@ -0,0 +1,3 @@
+
+%version = global [3 x sbyte] c"1\00\00"
+
diff --git a/test/CodeGen/CBackend/2003-06-11-HexConstant.ll b/test/CodeGen/CBackend/2003-06-11-HexConstant.ll
new file mode 100644
index 0000000..31bbf88
--- /dev/null
+++ b/test/CodeGen/CBackend/2003-06-11-HexConstant.ll
@@ -0,0 +1,3 @@
+; Make sure hex constant does not continue into a valid hexadecimal letter/number
+%version = global [3 x sbyte] c"\001\00"
+
diff --git a/test/CodeGen/CBackend/2003-06-11-LiteralStringProblem.ll b/test/CodeGen/CBackend/2003-06-11-LiteralStringProblem.ll
new file mode 100644
index 0000000..80d8aea
--- /dev/null
+++ b/test/CodeGen/CBackend/2003-06-11-LiteralStringProblem.ll
@@ -0,0 +1,3 @@
+
+%version = global [3 x sbyte] c"1\00\00"
+
diff --git a/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll b/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll
new file mode 100644
index 0000000..036b114
--- /dev/null
+++ b/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll
@@ -0,0 +1,28 @@
+; RUN: as < %s | opt -adce -disable-output
+%G = external global int*
+
+implementation ; Functions:
+
+declare void %Fn(int*)
+
+int %main(int %argc.1, sbyte** %argv.1) {
+entry: ; No predecessors!
+ br label %endif.42
+
+endif.42: ; preds = %entry, %shortcirc_done.12, %then.66, %endif.42
+ br bool false, label %endif.65, label %endif.42
+
+then.66: ; preds = %shortcirc_done.12
+ call void %Fn( int* %tmp.2846)
+ br label %endif.42
+
+endif.65: ; preds = %endif.42
+ %tmp.2846 = load int** %G
+ br bool false, label %shortcirc_next.12, label %shortcirc_done.12
+
+shortcirc_next.12: ; preds = %endif.65
+ br label %shortcirc_done.12
+
+shortcirc_done.12: ; preds = %endif.65, %shortcirc_next.12
+ br bool false, label %then.66, label %endif.42
+}
diff --git a/test/Transforms/DSAnalysis/physicalsubtype.ll b/test/Transforms/DSAnalysis/physicalsubtype.ll
new file mode 100644
index 0000000..cdda0d5
--- /dev/null
+++ b/test/Transforms/DSAnalysis/physicalsubtype.ll
@@ -0,0 +1,14 @@
+; A test for "physical subtyping" used in some C programs...
+;
+%ST = type { int, int* } ; "Subtype"
+%DT = type { int, int*, int } ; "derived type"
+
+int %test(%DT* %DT) {
+ %DTp = getelementptr %DT* %DT, long 0, ubyte 0
+ %A = load int* %DTp
+ %ST = cast %DT* %DT to %ST*
+ %STp = getelementptr %ST* %ST, long 0, ubyte 0
+ %B = load int* %STp
+ %C = sub int %A, %B ; A & B are equal, %C = 0
+ ret int %C
+}
diff --git a/test/Transforms/DeadArgElim/Makefile b/test/Transforms/DeadArgElim/Makefile
new file mode 100644
index 0000000..91acd4d
--- /dev/null
+++ b/test/Transforms/DeadArgElim/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 $(LOPT)
+ -$(TESTRUNR) $<
diff --git a/test/Transforms/DeadArgElim/basictest.ll b/test/Transforms/DeadArgElim/basictest.ll
new file mode 100644
index 0000000..8d70f53
--- /dev/null
+++ b/test/Transforms/DeadArgElim/basictest.ll
@@ -0,0 +1,27 @@
+; RUN: if as < %s | opt -load ~/llvm/lib/Debug/libhello.so -deadargelim | dis | grep DEADARG
+; RUN: then exit 1
+; RUN: else exit 0
+; RUN: fi
+
+implementation
+
+; test - an obviously dead argument
+internal int %test(int %v, int %DEADARG1, int* %p) {
+ store int %v, int* %p
+ ret int %v
+}
+
+; hardertest - an argument which is only used by a call of a function with a
+; dead argument.
+internal int %hardertest(int %DEADARG2) {
+ %p = alloca int
+ %V = call int %test(int 5, int %DEADARG2, int* %p)
+ ret int %V
+}
+
+; evenhardertest - recursive dead argument...
+internal void %evenhardertest(int %DEADARG3) {
+ call void %evenhardertest(int %DEADARG3)
+ ret void
+}
+
diff --git a/test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll b/test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll
new file mode 100644
index 0000000..77a087a
--- /dev/null
+++ b/test/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll
@@ -0,0 +1,14 @@
+; This testcase shows a bug where an common subexpression exists, but there
+; is no shared dominator block that the expression can be hoisted out to.
+;
+; RUN: if as < %s | opt -load-vn -gcse | dis | grep load
+; RUN: then exit 1
+; RUN: else exit 0
+; RUN: fi
+
+int %test(int* %P) {
+ store int 5, int* %P
+ %Z = load int* %P
+ ret int %Z
+}
+