summaryrefslogtreecommitdiffstats
path: root/llvm/test/Assembler
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
commit466876b0a652f75e8132052fa1c4bf4cf09380c0 (patch)
treeca1902cb47f1a5cee3aee9c8a096c80eb4732692 /llvm/test/Assembler
parentb66173820314f8ccbf31874e3db64c8ba1319d95 (diff)
downloadbcm5719-llvm-466876b0a652f75e8132052fa1c4bf4cf09380c0.tar.gz
bcm5719-llvm-466876b0a652f75e8132052fa1c4bf4cf09380c0.zip
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. llvm-svn: 78859
Diffstat (limited to 'llvm/test/Assembler')
-rw-r--r--llvm/test/Assembler/unnamed.ll42
1 files changed, 42 insertions, 0 deletions
diff --git a/llvm/test/Assembler/unnamed.ll b/llvm/test/Assembler/unnamed.ll
new file mode 100644
index 00000000000..31f1b581c5d
--- /dev/null
+++ b/llvm/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
+}
OpenPOWER on IntegriCloud