From 4a8068f19a521f5b9d940e015985dadf9f7676cf Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 13 Jan 2003 01:03:16 +0000 Subject: [PATCH] New testcases git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5261 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../ExecutionEngine/2003-01-04-ArgumentBug.ll | 18 +++++++++++++++ test/ExecutionEngine/2003-01-04-LoopTest.ll | 22 +++++++++++++++++++ test/ExecutionEngine/2003-01-09-SARTest.ll | 8 +++++++ test/ExecutionEngine/2003-01-10-FUCOM.ll | 8 +++++++ test/ExecutionEngine/test-malloc.ll | 11 ++++++++++ 5 files changed, 67 insertions(+) create mode 100644 test/ExecutionEngine/2003-01-04-ArgumentBug.ll create mode 100644 test/ExecutionEngine/2003-01-04-LoopTest.ll create mode 100644 test/ExecutionEngine/2003-01-09-SARTest.ll create mode 100644 test/ExecutionEngine/2003-01-10-FUCOM.ll create mode 100644 test/ExecutionEngine/test-malloc.ll diff --git a/test/ExecutionEngine/2003-01-04-ArgumentBug.ll b/test/ExecutionEngine/2003-01-04-ArgumentBug.ll new file mode 100644 index 00000000000..26216f72376 --- /dev/null +++ b/test/ExecutionEngine/2003-01-04-ArgumentBug.ll @@ -0,0 +1,18 @@ + +implementation ; Functions: + +declare void %__main() + +int %foo(int %X, int %Y, double %A) { +bb0: ; No predecessors! + %cond212 = setne double %A, 1.000000e+00 ; [#uses=1] + %cast110 = cast bool %cond212 to int ; [#uses=1] + ret int %cast110 +} + +int %main() { +bb0: ; No predecessors! + call void %__main( ) + %reg212 = call int %foo( int 0, int 1, double 1.000000e+00 ) ; [#uses=1] + ret int %reg212 +} diff --git a/test/ExecutionEngine/2003-01-04-LoopTest.ll b/test/ExecutionEngine/2003-01-04-LoopTest.ll new file mode 100644 index 00000000000..4aedd2dbf36 --- /dev/null +++ b/test/ExecutionEngine/2003-01-04-LoopTest.ll @@ -0,0 +1,22 @@ +implementation + +int %main() { + call int %mylog(int 4) + ret int 0 +} + +internal int %mylog(int %num) { +bb0: ; No predecessors! + br label %bb2 + +bb2: + %reg112 = phi int [ 10, %bb2 ], [ 1, %bb0 ] + %cann-indvar = phi int [ %cann-indvar, %bb2 ], [0, %bb0] + %reg114 = add int %reg112, 1 + %cond222 = setlt int %reg114, %num + br bool %cond222, label %bb2, label %bb3 + +bb3: ; preds = %bb2, %bb0 + ret int %reg114 +} + diff --git a/test/ExecutionEngine/2003-01-09-SARTest.ll b/test/ExecutionEngine/2003-01-09-SARTest.ll new file mode 100644 index 00000000000..b19a93172fe --- /dev/null +++ b/test/ExecutionEngine/2003-01-09-SARTest.ll @@ -0,0 +1,8 @@ +; We were accidentally inverting the signedness of right shifts. Whoops. + +int %main() { + %X = shr int -1, ubyte 16 + %Y = shr int %X, ubyte 16 + %Z = add int %Y, 1 + ret int %Z +} diff --git a/test/ExecutionEngine/2003-01-10-FUCOM.ll b/test/ExecutionEngine/2003-01-10-FUCOM.ll new file mode 100644 index 00000000000..37448f040ef --- /dev/null +++ b/test/ExecutionEngine/2003-01-10-FUCOM.ll @@ -0,0 +1,8 @@ + +int %main() { + %X = add double 0.0, 1.0 + %Y = sub double 0.0, 1.0 + %Z = seteq double %X, %Y + add double %Y, 0.0 + ret int 0 +} diff --git a/test/ExecutionEngine/test-malloc.ll b/test/ExecutionEngine/test-malloc.ll new file mode 100644 index 00000000000..701d02b6fe0 --- /dev/null +++ b/test/ExecutionEngine/test-malloc.ll @@ -0,0 +1,11 @@ + +int %main() { + %X = malloc int ; constant size + %Y = malloc int, uint 100 ; constant size + %u = add uint 1, 2 + %Z = malloc int, uint %u ; variable size + free int* %X + free int* %Y + free int* %Z + ret int 0 +}