diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-12 23:32:33 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-12 23:32:33 +0000 |
commit | 3845e50edea58edd0f5e0f2b732e0106b53ba279 (patch) | |
tree | f9b3d3c62fff3308052104b329a4a487fec4f82d /test | |
parent | 066dbb6415cf724ff389348b440bcbb7acd60d00 (diff) | |
download | external_llvm-3845e50edea58edd0f5e0f2b732e0106b53ba279.zip external_llvm-3845e50edea58edd0f5e0f2b732e0106b53ba279.tar.gz external_llvm-3845e50edea58edd0f5e0f2b732e0106b53ba279.tar.bz2 |
Extend the AsmWriter to print unnamed numbered types as "%0 = type ..."
and unnamed numbered global variables as "@0 = global ...". Extend the
AsmParser to recognize these forms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Assembler/unnamed.ll | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/Assembler/unnamed.ll b/test/Assembler/unnamed.ll new file mode 100644 index 0000000..31f1b58 --- /dev/null +++ b/test/Assembler/unnamed.ll @@ -0,0 +1,42 @@ +; RUN: llvm-as < %s | llvm-dis + +%0 = type { %1, %2 } ; type %0 +%1 = type { i32 } ; type %1 +%2 = type { float, double } ; type %2 + +@0 = global i32 0 +@1 = global float 3.0 +@2 = global i8* null + +define float @foo(%0* %p) nounwind { + %t = load %0* %p ; <%0> [#uses=2] + %s = extractvalue %0 %t, 1, 0 ; <float> [#uses=1] + %r = insertvalue %0 %t, double 2.000000e+00, 1, 1; <%0> [#uses=1] + store %0 %r, %0* %p + ret float %s +} + +define float @bar(%0* %p) nounwind { + store %0 { %1 { i32 4 }, %2 { float 4.000000e+00, double 2.000000e+01 } }, %0* %p + ret float 7.000000e+00 +} + +define float @car(%0* %p) nounwind { + store %0 { %1 undef, %2 { float undef, double 2.000000e+01 } }, %0* %p + ret float undef +} + +define float @dar(%0* %p) nounwind { + store %0 { %1 zeroinitializer, %2 { float 0.000000e+00, double 2.000000e+01 } }, %0* %p + ret float 0.000000e+00 +} + +define i32* @qqq() { + ret i32* @0 +} +define float* @rrr() { + ret float* @1 +} +define i8** @sss() { + ret i8** @2 +} |