diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2008-06-05 14:00:36 +0000 |
---|---|---|
committer | Matthijs Kooijman <matthijs@stdin.nl> | 2008-06-05 14:00:36 +0000 |
commit | 310e960e71c9f64b9e5610611cf703722dfe9216 (patch) | |
tree | b3dc24c3bdad6d56fcf2a30ec71da8f6b85bc77e /test | |
parent | 11aa6a415e3d02bddf5bb8fb65b7d0bf3608b6cf (diff) | |
download | external_llvm-310e960e71c9f64b9e5610611cf703722dfe9216.zip external_llvm-310e960e71c9f64b9e5610611cf703722dfe9216.tar.gz external_llvm-310e960e71c9f64b9e5610611cf703722dfe9216.tar.bz2 |
Change the Verifier to support returning first class aggregrates.
Add a testcase for functions returning first class aggregrates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Assembler/AggregrateReturn.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Assembler/AggregrateReturn.ll b/test/Assembler/AggregrateReturn.ll new file mode 100644 index 0000000..264b343 --- /dev/null +++ b/test/Assembler/AggregrateReturn.ll @@ -0,0 +1,22 @@ +; RUN: llvm-as < %s | llvm-dis + +define { i32, i32 } @foo() { + %res = insertvalue { i32, i32 } undef, i32 0, 0 + %res2 = insertvalue { i32, i32 } %res, i32 1, 1 + ret { i32, i32 } %res2 +} + +define [ 2 x i32 ] @bar() { + %res = insertvalue [ 2 x i32 ] undef, i32 0, 0 + %res2 = insertvalue [ 2 x i32 ] %res, i32 1, 1 + ret [ 2 x i32 ] %res2 +} + +define i32 @main() { + %a = call { i32, i32 }()* @foo () + %b = call [ 2 x i32 ]()* @bar () + %a.0 = extractvalue { i32, i32 } %a, 0 + %b.1 = extractvalue [ 2 x i32 ] %b, 1 + %r = add i32 %a.0, %b.1 + ret i32 %r +} |