blob: 9a876d2cedb0a96f1149ea9b5f5a4dac83f6c5fc [file] [log] [blame]
Tanya Lattner3f7706b2004-11-07 06:08:43 +00001; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
2; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3; RUN: diff %t1.ll %t2.ll
4
Chris Lattner5bc20c72001-10-13 07:16:11 +00005; This testcase is primarily used for testing that global values can be used as
6; constant pointer initializers. This is tricky because they can be forward
7; declared and involves an icky bytecode encoding. There is no meaningful
8; optimization that can be performed on this file, it is just here to test
9; assembly and disassembly.
10;
11
12
13%t3 = global int * %t1 ;; Forward reference
14%t1 = global int 4
Vikram S. Adveb26ff622002-07-14 23:18:33 +000015%t4 = global int ** %t3 ;; reference to reference
16
Chris Lattner5bc20c72001-10-13 07:16:11 +000017%t2 = global int * %t1
18
19global float * %0 ;; Forward numeric reference
20global float * %0 ;; Duplicate forward numeric reference
21global float 0.0
22global float * %0 ;; Numeric reference
23
24
25%fptr = global void() * %f ;; Forward ref method defn
26declare void "f"() ;; External method
27
Vikram S. Adveb26ff622002-07-14 23:18:33 +000028%sptr1 = global [11x sbyte]* %somestr ;; Forward ref to a constant
29%somestr = constant [11x sbyte] c"hello world"
30%sptr2 = global [11x sbyte]* %somestr
31
Chris Lattner5bc20c72001-10-13 07:16:11 +000032implementation
33