mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
New testcases for bugs and the new DAE pass
llvm-svn: 6693
This commit is contained in:
parent
713b9542eb
commit
25e6231cd8
17
test/Regression/C++Frontend/2003-06-08-BaseType.cpp
Normal file
17
test/Regression/C++Frontend/2003-06-08-BaseType.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
struct foo {
|
||||
int y;
|
||||
foo();
|
||||
};
|
||||
|
||||
struct bar : public foo {
|
||||
//int x;
|
||||
bar();
|
||||
};
|
||||
|
||||
//int bar::X() { return 0; }
|
||||
|
||||
bar::bar() {
|
||||
|
||||
}
|
23
test/Regression/C++Frontend/2003-06-08-VirtualFunctions.cpp
Normal file
23
test/Regression/C++Frontend/2003-06-08-VirtualFunctions.cpp
Normal file
@ -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() {
|
||||
|
||||
}
|
8
test/Regression/C++Frontend/2003-06-13-Crasher.cpp
Normal file
8
test/Regression/C++Frontend/2003-06-13-Crasher.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
void bar();
|
||||
|
||||
void foo() {
|
||||
struct TEST {
|
||||
~TEST() { bar(); }
|
||||
} TESTOBJ;
|
||||
|
||||
}
|
3
test/Regression/CBackend/2003-06-11-HexConstant.ll
Normal file
3
test/Regression/CBackend/2003-06-11-HexConstant.ll
Normal file
@ -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"
|
||||
|
@ -0,0 +1,3 @@
|
||||
|
||||
%version = global [3 x sbyte] c"1\00\00"
|
||||
|
28
test/Regression/Transforms/ADCE/2003-06-11-InvalidCFG.ll
Normal file
28
test/Regression/Transforms/ADCE/2003-06-11-InvalidCFG.ll
Normal file
@ -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
|
||||
}
|
14
test/Regression/Transforms/DSAnalysis/physicalsubtype.ll
Normal file
14
test/Regression/Transforms/DSAnalysis/physicalsubtype.ll
Normal file
@ -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
|
||||
}
|
10
test/Regression/Transforms/DeadArgElim/Makefile
Normal file
10
test/Regression/Transforms/DeadArgElim/Makefile
Normal file
@ -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) $<
|
27
test/Regression/Transforms/DeadArgElim/basictest.ll
Normal file
27
test/Regression/Transforms/DeadArgElim/basictest.ll
Normal file
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user