mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
New testcases
llvm-svn: 4455
This commit is contained in:
parent
0396c5461e
commit
6543ec06a6
22
test/Regression/Transforms/DSAnalysis/basictest.ll
Normal file
22
test/Regression/Transforms/DSAnalysis/basictest.ll
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
; very simple test
|
||||
|
||||
implementation
|
||||
|
||||
int *%foo(ulong %A, double %B, long %C) {
|
||||
%X = malloc int*
|
||||
%D = cast int** %X to ulong
|
||||
%E = cast ulong %D to int*
|
||||
store int* %E, int** %X
|
||||
|
||||
%F = malloc {int}
|
||||
%G = getelementptr {int}* %F, long 0, ubyte 0
|
||||
store int* %G, int** %X
|
||||
|
||||
%K = malloc int **
|
||||
store int** %X, int***%K
|
||||
|
||||
%H = cast long %C to int*
|
||||
ret int* null ; %H
|
||||
}
|
||||
|
32
test/Regression/Transforms/DSAnalysis/indcalltest.ll
Normal file
32
test/Regression/Transforms/DSAnalysis/indcalltest.ll
Normal file
@ -0,0 +1,32 @@
|
||||
%G = global int 2 ; <int*> [#uses=1]
|
||||
%H = global int* null
|
||||
|
||||
%I = global int** null
|
||||
%J = global int** null
|
||||
|
||||
implementation ; Functions:
|
||||
|
||||
void %foo1() {
|
||||
store int* %G, int** %H
|
||||
store int** %H, int ***%I
|
||||
ret void
|
||||
}
|
||||
|
||||
void %foo2() { ; No predecessors!
|
||||
store int 7, int* %G
|
||||
store int** %H, int ***%J
|
||||
ret void
|
||||
}
|
||||
|
||||
void %test(bool %cond) {
|
||||
; <label>:0 ; No predecessors!
|
||||
br bool %cond, label %call, label %F
|
||||
|
||||
F: ; preds = %0
|
||||
br label %call
|
||||
|
||||
call: ; preds = %F, %0
|
||||
%Fn = phi void ()* [ %foo2, %F ], [ %foo1, %0 ] ; <void ()*> [#uses=1]
|
||||
call void %Fn()
|
||||
ret void
|
||||
}
|
11
test/Regression/Transforms/DSAnalysis/simpletest.ll
Normal file
11
test/Regression/Transforms/DSAnalysis/simpletest.ll
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
implementation
|
||||
|
||||
int *%foo(int *%A, int **%B, int *%C, int **%D, int* %E) {
|
||||
%a = load int* %A
|
||||
%b = load int** %B
|
||||
|
||||
store int* %C, int** %D
|
||||
|
||||
ret int* %E
|
||||
}
|
Loading…
Reference in New Issue
Block a user