diff options
author | Dan Gohman <gohman@apple.com> | 2008-05-23 01:55:30 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-05-23 01:55:30 +0000 |
commit | e4977cf750eaff28275429191821420c20b0c64f (patch) | |
tree | f1adda18e6df59cfb561a32a7d2034a053e06826 /test/Assembler | |
parent | 8f8e2692705f37d61e1840e799288f2ade1e410f (diff) | |
download | llvm-e4977cf750eaff28275429191821420c20b0c64f.tar.gz llvm-e4977cf750eaff28275429191821420c20b0c64f.tar.bz2 llvm-e4977cf750eaff28275429191821420c20b0c64f.tar.xz |
Make structs and arrays first-class types, and add assembly
and bitcode support for the extractvalue and insertvalue
instructions and constant expressions.
Note that this does not yet include CodeGen support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Assembler')
-rw-r--r-- | test/Assembler/insertextractvalue.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Assembler/insertextractvalue.ll b/test/Assembler/insertextractvalue.ll new file mode 100644 index 0000000000..ae03f45bce --- /dev/null +++ b/test/Assembler/insertextractvalue.ll @@ -0,0 +1,13 @@ +; RUN: llvm-as < %s + +;define float @foo({{i32},{float, double}}* %p) { + ;%t = load {{i32},{float, double}}* %p + ;%s = extractvalue {{i32},{float, double}} %t, i32 1, i32 0 + ;%r = insertvalue {{i32},{float, double}} %t, double 2.0, i32 1, i32 1 + ;store {{i32},{float, double}} %r, {{i32},{float, double}}* %p + ;ret float %s +;} +define float @bar({{i32},{float, double}}* %p) { + store {{i32},{float, double}} insertvalue ({{i32},{float, double}}{{i32}{i32 4},{float, double}{float 4.0, double 5.0}}, double 20.0, i32 1, i32 1), {{i32},{float, double}}* %p + ret float extractvalue ({{i32},{float, double}}{{i32}{i32 3},{float, double}{float 7.0, double 9.0}}, i32 1, i32 0) +} |