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, i32* @var
13 @var2 = alias i32, i32* @var1
14 @var_l = linkonce_odr alias i32, i32* @var
15 @var_i = internal alias i32, i32* @var
16 @var_h = hidden alias i32, i32* @var
17 @var_p = protected alias i32, i32* @var
19 @array = global [2 x i32] [i32 1, i32 2], align 4
20 @x = global i32* bitcast (i8* getelementptr (i8, i8* bitcast ([2 x i32]* @array to i8*), i64 4) to i32*), align 4
21 @bitcast_alias = alias i32*, i32** @x
28 @fun_weak = weak alias %FunTy, %FunTy* @fun
29 @fun_hidden = hidden alias %FunTy, %FunTy* @fun
30 @fun_ptr = global i32()* @fun_weak
34 %tmp = load i32, i32* @var1
35 %tmp1 = load i32, i32* @var2
36 %tmp0 = load i32, i32* @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 i32 ()*
44 store i32 ()* @fun_weak, i32 ()** %fun_ptr1
45 %callee.knr.cast = bitcast i32 ()** %fun_ptr1 to i32 ()*
46 %tmp8 = call i32 %callee.knr.cast()
47 %tmp9 = call i32 @fun_hidden()
48 %tmp10 = add i32 %tmp7, %tmp8
49 %tmp11 = add i32 %tmp10, %tmp9
54 ; ASM-NEXT: .globl .fun
56 ; ASM-NEXT: .csect fun[DS]
57 ; ASM-NEXT: fun_weak: # @fun
58 ; ASM-NEXT: fun_hidden:
59 ; ASM: .csect .text[PR],2
61 ; ASM-NEXT: .fun_weak:
62 ; ASM-NEXT: .fun_hidden:
66 ; ASM-NEXT: # -- End function
67 ; ASM: .csect .text[PR],2
69 ; ASM-NEXT: # %bb.0: # %entry
75 ; ASM: # -- End function
76 ; ASM-NEXT: .csect .data[RW]
77 ; ASM-NEXT: .globl var
85 ; ASM-NEXT: .vbyte 4, 42
86 ; ASM-NEXT: .globl array
88 ; ASM-NEXT: .vbyte 4, 1 # 0x1
89 ; ASM-NEXT: .vbyte 4, 2 # 0x2
92 ; ASM-NEXT: bitcast_alias:
93 ; ASM-NEXT: .vbyte {{[0-9]+}}, array+4
94 ; ASM-NEXT: .globl fun_ptr
96 ; ASM-NEXT: .vbyte {{[0-9]+}}, fun_weak
97 ; ASM-NEXT: .globl var1
98 ; ASM-NEXT: .globl var2
99 ; ASM-NEXT: .weak var_l
100 ; ASM-NEXT: .lglobl var_i
101 ; ASM-NEXT: .globl var_h,hidden
102 ; ASM-NEXT: .globl var_p,protected
103 ; ASM-NEXT: .globl bitcast_alias
104 ; ASM-NEXT: .weak fun_weak
105 ; ASM-NEXT: .weak .fun_weak
106 ; ASM-NEXT: .globl fun_hidden,hidden
107 ; ASM-NEXT: .globl .fun_hidden,hidden
110 ; ASM-NEXT: .tc var1[TC],var1
112 ; ASM-NEXT: .tc var2[TC],var2
114 ; ASM-NEXT: .tc var_i[TC],var_i
116 ; ASM-NEXT: .tc fun_weak[TC],fun_weak