summaryrefslogtreecommitdiff
path: root/test/Assembler/unnamed.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-08-12 23:32:33 +0000
committerDan Gohman <gohman@apple.com>2009-08-12 23:32:33 +0000
commit3845e50edea58edd0f5e0f2b732e0106b53ba279 (patch)
treef9b3d3c62fff3308052104b329a4a487fec4f82d /test/Assembler/unnamed.ll
parent066dbb6415cf724ff389348b440bcbb7acd60d00 (diff)
downloadllvm-3845e50edea58edd0f5e0f2b732e0106b53ba279.tar.gz
llvm-3845e50edea58edd0f5e0f2b732e0106b53ba279.tar.bz2
llvm-3845e50edea58edd0f5e0f2b732e0106b53ba279.tar.xz
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/Assembler/unnamed.ll')
-rw-r--r--test/Assembler/unnamed.ll42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/Assembler/unnamed.ll b/test/Assembler/unnamed.ll
new file mode 100644
index 0000000000..31f1b581c5
--- /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
+}