diff options
author | Dan Gohman <gohman@apple.com> | 2008-06-03 00:15:20 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-06-03 00:15:20 +0000 |
commit | 6e68f59b78d8dcb3940469351a08d5884f190223 (patch) | |
tree | a24c1073c60b8272c89e9b770fc8293782c0b426 /test/Assembler | |
parent | 2f170997b5349bf7e9ef4cb5cb38af5f7df0c54b (diff) | |
download | external_llvm-6e68f59b78d8dcb3940469351a08d5884f190223.zip external_llvm-6e68f59b78d8dcb3940469351a08d5884f190223.tar.gz external_llvm-6e68f59b78d8dcb3940469351a08d5884f190223.tar.bz2 |
Constant folding for insertvalue and extractvalue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51889 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Assembler')
-rw-r--r-- | test/Assembler/insertextractvalue.ll | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/Assembler/insertextractvalue.ll b/test/Assembler/insertextractvalue.ll index bdd0932..0da0b77 100644 --- a/test/Assembler/insertextractvalue.ll +++ b/test/Assembler/insertextractvalue.ll @@ -1,4 +1,6 @@ -; RUN: llvm-as < %s +; RUN: llvm-as < %s | llvm-dis > %t +; RUN: grep insertvalue %t | count 1 +; RUN: grep extractvalue %t | count 1 define float @foo({{i32},{float, double}}* %p) { %t = load {{i32},{float, double}}* %p @@ -11,3 +13,11 @@ 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, 1, 1), {{i32},{float, double}}* %p ret float extractvalue ({{i32},{float, double}}{{i32}{i32 3},{float, double}{float 7.0, double 9.0}}, 1, 0) } +define float @car({{i32},{float, double}}* %p) { + store {{i32},{float, double}} insertvalue ({{i32},{float, double}} undef, double 20.0, 1, 1), {{i32},{float, double}}* %p + ret float extractvalue ({{i32},{float, double}} undef, 1, 0) +} +define float @dar({{i32},{float, double}}* %p) { + store {{i32},{float, double}} insertvalue ({{i32},{float, double}} zeroinitializer, double 20.0, 1, 1), {{i32},{float, double}}* %p + ret float extractvalue ({{i32},{float, double}} zeroinitializer, 1, 0) +} |