1 ;; This file tests how llc handles symbols containing invalid characters on an
3 ;; Since symbol name resolution is the same between 32-bit and 64-bit,
4 ;; tests for 64-bit mode are omitted.
6 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
7 ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false < %s | \
8 ; RUN: FileCheck --check-prefix=ASM %s
10 ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
11 ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false -filetype=obj -o %t.o < %s
12 ; RUN: llvm-objdump -D -r --symbol-description %t.o | \
13 ; RUN: FileCheck --check-prefix=OBJ %s
16 @"f\60o" = global i32 10, align 4
19 @"f\22o\22" = common global i32 0, align 4
22 @"f\3do" = internal global i32 0, align 4
24 define internal i32 @f$o() {
26 %call = call i32 @"f\40o"()
31 define i32 @"f\26o"() {
33 %tmp = call i32 @f$o()
34 %tmp1 = load i32, ptr @"f\3do"
35 %tmp2 = add i32 %tmp, %tmp1
40 define ptr @"f\26_o"() {
46 declare i32 @"f\40o"(...)
48 ; ASM: .lglobl _Renamed..24f_o[DS] # -- Begin function f$o
49 ; ASM-NEXT: .rename _Renamed..24f_o[DS],"f$o"
50 ; ASM-NEXT: .lglobl ._Renamed..24f_o
51 ; ASM-NEXT: .rename ._Renamed..24f_o,".f$o"
53 ; ASM-NEXT: .csect _Renamed..24f_o[DS],2
54 ; ASM-NEXT: .vbyte 4, ._Renamed..24f_o # @"f$o"
55 ; ASM-NEXT: .vbyte 4, TOC[TC0]
56 ; ASM-NEXT: .vbyte 4, 0
57 ; ASM-NEXT: .csect [PR],5
58 ; ASM-NEXT: ._Renamed..24f_o:
59 ; ASM: bl ._Renamed..40f_o[PR]
61 ; ASM: .globl _Renamed..26f_o[DS] # -- Begin function f&o
62 ; ASM-NEXT: .rename _Renamed..26f_o[DS],"f&o"
63 ; ASM-NEXT: .globl ._Renamed..26f_o
64 ; ASM-NEXT: .rename ._Renamed..26f_o,".f&o"
66 ; ASM-NEXT: .csect _Renamed..26f_o[DS],2
67 ; ASM-NEXT: .vbyte 4, ._Renamed..26f_o # @"f&o"
68 ; ASM-NEXT: .vbyte 4, TOC[TC0]
69 ; ASM-NEXT: .vbyte 4, 0
70 ; ASM-NEXT: .csect [PR],5
71 ; ASM-NEXT: ._Renamed..26f_o:
72 ; ASM: bl ._Renamed..24f_o
73 ; ASM: .globl _Renamed..265ff__o[DS] # -- Begin function f&_o
74 ; ASM-NEXT: .rename _Renamed..265ff__o[DS],"f&_o"
75 ; ASM-NEXT: .globl ._Renamed..265ff__o
76 ; ASM-NEXT: .rename ._Renamed..265ff__o,".f&_o"
78 ; ASM-NEXT: .csect _Renamed..265ff__o[DS],2
79 ; ASM-NEXT: .vbyte 4, ._Renamed..265ff__o # @"f&_o"
80 ; ASM-NEXT: .vbyte 4, TOC[TC0]
81 ; ASM-NEXT: .vbyte 4, 0
82 ; ASM-NEXT: .csect [PR],5
83 ; ASM-NEXT: ._Renamed..265ff__o:
84 ; ASM: .csect .data[RW],2
85 ; ASM-NEXT: .globl _Renamed..60f_o
86 ; ASM-NEXT: .rename _Renamed..60f_o,"f`o"
88 ; ASM-NEXT: _Renamed..60f_o:
89 ; ASM-NEXT: .vbyte 4, 10 # 0xa
90 ; ASM-NEXT: .comm _Renamed..2222f_o_[RW],4,2
91 ; ASM-NEXT: .rename _Renamed..2222f_o_[RW],"f""o"""
92 ; ASM-NEXT: .lcomm _Renamed..3df_o,4,_Renamed..3df_o[BS],2
93 ; ASM-NEXT: .rename _Renamed..3df_o[BS],"f=o"
94 ; ASM-NEXT: .extern ._Renamed..40f_o[PR]
95 ; ASM-NEXT: .rename ._Renamed..40f_o[PR],".f@o"
96 ; ASM-NEXT: .extern _Renamed..40f_o[DS]
97 ; ASM-NEXT: .rename _Renamed..40f_o[DS],"f@o"
100 ; ASM-NEXT: .tc _Renamed..3df_o[TC],_Renamed..3df_o[BS]
101 ; ASM-NEXT: .rename _Renamed..3df_o[TC],"f=o"
103 ; ASM-NEXT: .tc _Renamed..40f_o[TC],_Renamed..40f_o[DS]
104 ; ASM-NEXT: .rename _Renamed..40f_o[TC],"f@o"
106 ; OBJ: Disassembly of section .text:
108 ; OBJ-NEXT: 00000000 (idx: 7) .f$o:
109 ; OBJ-NEXT: 0: 7c 08 02 a6 mflr 0
110 ; OBJ-NEXT: 4: 94 21 ff c0 stwu 1, -64(1)
111 ; OBJ-NEXT: 8: 90 01 00 48 stw 0, 72(1)
112 ; OBJ-NEXT: c: 4b ff ff f5 bl 0x0
113 ; OBJ-NEXT: 0000000c: R_RBR (idx: 1) .f@o[PR]
114 ; OBJ-NEXT: 10: 60 00 00 00 nop
115 ; OBJ-NEXT: 14: 38 21 00 40 addi 1, 1, 64
116 ; OBJ-NEXT: 18: 80 01 00 08 lwz 0, 8(1)
117 ; OBJ-NEXT: 1c: 7c 08 03 a6 mtlr 0
118 ; OBJ-NEXT: 20: 4e 80 00 20 blr
119 ; OBJ-NEXT: 24: 60 00 00 00 nop
120 ; OBJ-NEXT: 28: 60 00 00 00 nop
121 ; OBJ-NEXT: 2c: 60 00 00 00 nop
123 ; OBJ-NEXT: 00000030 (idx: 9) .f&o:
124 ; OBJ-NEXT: 30: 7c 08 02 a6 mflr 0
125 ; OBJ-NEXT: 34: 94 21 ff c0 stwu 1, -64(1)
126 ; OBJ-NEXT: 38: 90 01 00 48 stw 0, 72(1)
127 ; OBJ-NEXT: 3c: 4b ff ff c5 bl 0x0
128 ; OBJ-NEXT: 40: 80 82 00 00 lwz 4, 0(2)
129 ; OBJ-NEXT: 00000042: R_TOC (idx: 25) f=o[TC]
130 ; OBJ-NEXT: 44: 80 84 00 00 lwz 4, 0(4)
131 ; OBJ-NEXT: 48: 7c 63 22 14 add 3, 3, 4
132 ; OBJ-NEXT: 4c: 38 21 00 40 addi 1, 1, 64
133 ; OBJ-NEXT: 50: 80 01 00 08 lwz 0, 8(1)
134 ; OBJ-NEXT: 54: 7c 08 03 a6 mtlr 0
135 ; OBJ-NEXT: 58: 4e 80 00 20 blr
136 ; OBJ-NEXT: 5c: 60 00 00 00 nop
138 ; OBJ-NEXT: 00000060 (idx: 11) .f&_o:
139 ; OBJ-NEXT: 60: 80 62 00 04 lwz 3, 4(2)
140 ; OBJ-NEXT: 00000062: R_TOC (idx: 27) f@o[TC]
141 ; OBJ-NEXT: 64: 4e 80 00 20 blr
143 ; OBJ-NEXT: Disassembly of section .data:
145 ; OBJ-NEXT: 00000068 (idx: 15) f`o:
146 ; OBJ-NEXT: 68: 00 00 00 0a <unknown>
148 ; OBJ-NEXT: 0000006c (idx: 17) f$o[DS]:
149 ; OBJ-NEXT: 6c: 00 00 00 00 <unknown>
150 ; OBJ-NEXT: 0000006c: R_POS (idx: 7) .f$o
151 ; OBJ-NEXT: 70: 00 00 00 90 <unknown>
152 ; OBJ-NEXT: 00000070: R_POS (idx: 23) TOC[TC0]
153 ; OBJ-NEXT: 74: 00 00 00 00 <unknown>
155 ; OBJ-NEXT: 00000078 (idx: 19) f&o[DS]:
156 ; OBJ-NEXT: 78: 00 00 00 30 <unknown>
157 ; OBJ-NEXT: 00000078: R_POS (idx: 9) .f&o
158 ; OBJ-NEXT: 7c: 00 00 00 90 <unknown>
159 ; OBJ-NEXT: 0000007c: R_POS (idx: 23) TOC[TC0]
160 ; OBJ-NEXT: 80: 00 00 00 00 <unknown>
162 ; OBJ-NEXT: 00000084 (idx: 21) f&_o[DS]:
163 ; OBJ-NEXT: 84: 00 00 00 60 <unknown>
164 ; OBJ-NEXT: 00000084: R_POS (idx: 11) .f&_o
165 ; OBJ-NEXT: 88: 00 00 00 90 <unknown>
166 ; OBJ-NEXT: 00000088: R_POS (idx: 23) TOC[TC0]
167 ; OBJ-NEXT: 8c: 00 00 00 00 <unknown>
169 ; OBJ-NEXT: 00000090 (idx: 25) f=o[TC]:
170 ; OBJ-NEXT: 90: 00 00 00 9c <unknown>
171 ; OBJ-NEXT: 00000090: R_POS (idx: 31) f=o[BS]
173 ; OBJ-NEXT: 00000094 (idx: 27) f@o[TC]:
174 ; OBJ-NEXT: 94: 00 00 00 00 <unknown>
175 ; OBJ-NEXT: 00000094: R_POS (idx: 3) f@o[DS]
177 ; OBJ-NEXT: Disassembly of section .bss:
179 ; OBJ-NEXT: 00000098 (idx: 29) f"o"[RW]:
182 ; OBJ-NEXT: 0000009c (idx: 31) f=o[BS]: