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 | 30499844ead34cae1687c3fb2cb697a695a38db2 (patch) | |
| tree | e4ed6d258fb8c12ad953a3352bbdb7275829dac3 /llvm/test | |
| parent | 53b2698531719c987822f8352844a23ab2d8c9d8 (diff) | |
| download | bcm5719-llvm-30499844ead34cae1687c3fb2cb697a695a38db2.tar.gz bcm5719-llvm-30499844ead34cae1687c3fb2cb697a695a38db2.zip | |
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.
llvm-svn: 51468
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Assembler/insertextractvalue.ll | 13 | ||||
| -rw-r--r-- | llvm/test/Verifier/2006-07-11-StoreStruct.ll | 6 |
2 files changed, 17 insertions, 2 deletions
diff --git a/llvm/test/Assembler/insertextractvalue.ll b/llvm/test/Assembler/insertextractvalue.ll new file mode 100644 index 00000000000..ae03f45bcef --- /dev/null +++ b/llvm/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) +} diff --git a/llvm/test/Verifier/2006-07-11-StoreStruct.ll b/llvm/test/Verifier/2006-07-11-StoreStruct.ll index 655e4b748ef..80ab122d0b7 100644 --- a/llvm/test/Verifier/2006-07-11-StoreStruct.ll +++ b/llvm/test/Verifier/2006-07-11-StoreStruct.ll @@ -1,5 +1,7 @@ -; RUN: not llvm-as < %s |& grep {Instruction operands must be first-class} -; PR826 +; RUN: llvm-as < %s |& not grep {Instruction operands must be first-class} + +; This previously was for PR826, but structs are now first-class so +; the following is now valid. %struct_4 = type { i32 } |

