summaryrefslogtreecommitdiffstats
path: root/llvm/test/exprtest.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-07-28 18:04:10 +0000
committerChris Lattner <sabre@nondot.org>2001-07-28 18:04:10 +0000
commitbf225041078531d0cabab939cedb642a8fd64b84 (patch)
treefb7449e9b12ee0c7b5c53ec280a367e3f89a44ca /llvm/test/exprtest.ll
parent3f14c6689030ebd3dbcec45f129bb4fc067c9157 (diff)
downloadbcm5719-llvm-bf225041078531d0cabab939cedb642a8fd64b84.tar.gz
bcm5719-llvm-bf225041078531d0cabab939cedb642a8fd64b84.zip
New test cases
llvm-svn: 329
Diffstat (limited to 'llvm/test/exprtest.ll')
-rw-r--r--llvm/test/exprtest.ll32
1 files changed, 32 insertions, 0 deletions
diff --git a/llvm/test/exprtest.ll b/llvm/test/exprtest.ll
new file mode 100644
index 00000000000..d7fb15c7039
--- /dev/null
+++ b/llvm/test/exprtest.ll
@@ -0,0 +1,32 @@
+implementation
+int "testExpressions"(int %N, int* %A)
+begin
+ %N1 = add int %N, 12
+ %N2 = mul int %N, 7
+ %N3 = add int %N1, %N2 ;; Should equal 8*N+12
+ %N4 = shl int %N3, ubyte 3 ;; Should equal 64*N + 96
+ %N5 = mul int %N4, 0 ;; 0
+ br label %1
+
+ %C = cast int 264 to ubyte ;; 8
+ %C1 = add ubyte 252, %C ;; 4
+ %C2 = cast ubyte %C1 to ulong ;; 4
+ %C3 = add ulong 12345678901, %C2 ;; 12345678905
+ %C4 = cast ulong %C3 to sbyte * ;; 12345678905
+ br label %2
+
+ %A1 = cast int 4 to int *
+ %A2 = add int *%A, %A1 ;; %A+4
+ %A3 = cast int 8 to int *
+ %A4 = add int *%A, %A3 ;; %A+8
+ %X = sub int *%A4, %A2 ;; Should equal 4
+ br label %3
+
+ %Z1 = cast int 400 to int *
+ %Z2 = cast sbyte 2 to int *
+ %Z3 = add int* %Z1, %Z2
+ %Z4 = cast int* %Z3 to ubyte
+
+ ret int %N4
+end
+
OpenPOWER on IntegriCloud