1 ; TODO: Add object generation test when visibility for object generation
4 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
5 ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | \
6 ; RUN: FileCheck --check-prefix=ASM %s
7 ; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
8 ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | \
9 ; RUN: FileCheck --check-prefix=ASM %s
12 @var1 = alias i32, ptr @var
13 @var2 = alias i32, ptr @var1
14 @var_l = linkonce_odr alias i32, ptr @var
15 @var_i = internal alias i32, ptr @var
16 @var_h = hidden alias i32, ptr @var
17 @var_p = protected alias i32, ptr @var
19 @array = global [2 x i32] [i32 1, i32 2], align 4
20 @x = global ptr getelementptr (i8, ptr @array, i64 4), align 4
21 @bitcast_alias = alias ptr, ptr @x
28 @fun_weak = weak alias %FunTy, ptr @fun
29 @fun_hidden = hidden alias %FunTy, ptr @fun
30 @fun_ptr = global ptr @fun_weak
34 %tmp = load i32, ptr @var1
35 %tmp1 = load i32, ptr @var2
36 %tmp0 = load i32, ptr @var_i
37 %tmp2 = call i32 @fun()
38 %tmp3 = add i32 %tmp, %tmp2
39 %tmp4 = call i32 @fun_weak()
40 %tmp5 = add i32 %tmp3, %tmp4
41 %tmp6 = add i32 %tmp1, %tmp5
42 %tmp7 = add i32 %tmp6, %tmp0
43 %fun_ptr1 = alloca ptr
44 store ptr @fun_weak, ptr %fun_ptr1
45 %tmp8 = call i32 %fun_ptr1()
46 %tmp9 = call i32 @fun_hidden()
47 %tmp10 = add i32 %tmp7, %tmp8
48 %tmp11 = add i32 %tmp10, %tmp9
53 ; ASM-NEXT: .globl .fun
55 ; ASM-NEXT: .csect fun[DS]
56 ; ASM-NEXT: fun_weak: # @fun
57 ; ASM-NEXT: fun_hidden:
58 ; ASM: .csect ..text..[PR],5
60 ; ASM-NEXT: .fun_weak:
61 ; ASM-NEXT: .fun_hidden:
65 ; ASM-NEXT: # -- End function
66 ; ASM: .csect ..text..[PR],5
68 ; ASM-NEXT: # %bb.0: # %entry
74 ; ASM: # -- End function
75 ; ASM-NEXT: .csect .data[RW]
76 ; ASM-NEXT: .globl var
77 ; ASM-NEXT: .globl var1
78 ; ASM-NEXT: .globl var2
79 ; ASM-NEXT: .weak var_l
80 ; ASM-NEXT: .lglobl var_i
81 ; ASM-NEXT: .globl var_h,hidden
82 ; ASM-NEXT: .globl var_p,protected
90 ; ASM-NEXT: .vbyte 4, 42
91 ; ASM-NEXT: .globl array
93 ; ASM-NEXT: .vbyte 4, 1 # 0x1
94 ; ASM-NEXT: .vbyte 4, 2 # 0x2
96 ; ASM-NEXT: .globl bitcast_alias
98 ; ASM-NEXT: bitcast_alias:
99 ; ASM-NEXT: .vbyte {{[0-9]+}}, array+4
100 ; ASM-NEXT: .globl fun_ptr
102 ; ASM-NEXT: .vbyte {{[0-9]+}}, fun_weak
103 ; ASM-NEXT: .weak fun_weak
104 ; ASM-NEXT: .weak .fun_weak
105 ; ASM-NEXT: .globl fun_hidden,hidden
106 ; ASM-NEXT: .globl .fun_hidden,hidden
109 ; ASM-NEXT: .tc var1[TC],var1
111 ; ASM-NEXT: .tc var2[TC],var2
113 ; ASM-NEXT: .tc var_i[TC],var_i
115 ; ASM-NEXT: .tc fun_weak[TC],fun_weak