1;; This file tests how llc handles symbols containing invalid characters on an 2;; XCOFF platform. 3;; Since symbol name resolution is the same between 32-bit and 64-bit, 4;; tests for 64-bit mode are omitted. 5 6; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \ 7; RUN: -mattr=-altivec -data-sections=false < %s | \ 8; RUN: FileCheck --check-prefix=ASM %s 9 10; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \ 11; RUN: -mattr=-altivec -data-sections=false -filetype=obj -o %t.o < %s 12; RUN: llvm-objdump -D -r --symbol-description %t.o | \ 13; RUN: FileCheck --check-prefix=OBJ %s 14 15; This is f`o 16@"f\60o" = global i32 10, align 4 17 18; This is f"o" 19@"f\22o\22" = common global i32 0, align 4 20 21; This is f=o 22@"f\3do" = internal global i32 0, align 4 23 24define internal i32 @f$o() { 25entry: 26 %call = call i32 bitcast (i32 (...)* @"f\40o" to i32 ()*)() 27 ret i32 %call 28} 29 30; This is f&o 31define i32 @"f\26o"() { 32entry: 33 %tmp = call i32 @f$o() 34 %tmp1 = load i32, i32* @"f\3do" 35 %tmp2 = add i32 %tmp, %tmp1 36 ret i32 %tmp2 37} 38 39; This is f&_o 40define i32 (...)* @"f\26_o"() { 41entry: 42 ret i32 (...)* @"f\40o" 43} 44 45; This is f@o 46declare i32 @"f\40o"(...) 47 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" 52; ASM-NEXT: .align 4 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 .text[PR],2 58; ASM-NEXT: ._Renamed..24f_o: 59; ASM: bl ._Renamed..40f_o[PR] 60; ASM-NEXT: nop 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" 65; ASM-NEXT: .align 4 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 .text[PR],2 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" 77; ASM-NEXT: .align 4 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 .text[PR],2 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" 87; ASM-NEXT: .align 2 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" 98; ASM-NEXT: .toc 99; ASM-NEXT: L..C0: 100; ASM-NEXT: .tc _Renamed..3df_o[TC],_Renamed..3df_o[BS] 101; ASM-NEXT: .rename _Renamed..3df_o[TC],"f=o" 102; ASM-NEXT: L..C1: 103; ASM-NEXT: .tc _Renamed..40f_o[TC],_Renamed..40f_o[DS] 104; ASM-NEXT: .rename _Renamed..40f_o[TC],"f@o" 105 106; OBJ: Disassembly of section .text: 107; OBJ-EMPTY: 108; OBJ-NEXT: 00000000 (idx: 6) .f$o: 109; OBJ-NEXT: 0: 7c 08 02 a6 mflr 0 110; OBJ-NEXT: 4: 90 01 00 08 stw 0, 8(1) 111; OBJ-NEXT: 8: 94 21 ff c0 stwu 1, -64(1) 112; OBJ-NEXT: c: 4b ff ff f5 bl 0x0 113; OBJ-NEXT: 0000000c: R_RBR (idx: 0) .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 122; OBJ-EMPTY: 123; OBJ-NEXT: 00000030 (idx: 8) .f&o: 124; OBJ-NEXT: 30: 7c 08 02 a6 mflr 0 125; OBJ-NEXT: 34: 90 01 00 08 stw 0, 8(1) 126; OBJ-NEXT: 38: 94 21 ff c0 stwu 1, -64(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: 24) 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 137; OBJ-EMPTY: 138; OBJ-NEXT: 00000060 (idx: 10) .f&_o: 139; OBJ-NEXT: 60: 80 62 00 04 lwz 3, 4(2) 140; OBJ-NEXT: 00000062: R_TOC (idx: 26) f@o[TC] 141; OBJ-NEXT: 64: 4e 80 00 20 blr 142; OBJ-EMPTY: 143; OBJ-NEXT: Disassembly of section .data: 144; OBJ-EMPTY: 145; OBJ-NEXT: 00000068 (idx: 14) f`o: 146; OBJ-NEXT: 68: 00 00 00 0a <unknown> 147; OBJ-EMPTY: 148; OBJ-NEXT: 0000006c (idx: 16) f$o[DS]: 149; OBJ-NEXT: 6c: 00 00 00 00 <unknown> 150; OBJ-NEXT: 0000006c: R_POS (idx: 6) .f$o 151; OBJ-NEXT: 70: 00 00 00 90 <unknown> 152; OBJ-NEXT: 00000070: R_POS (idx: 22) TOC[TC0] 153; OBJ-NEXT: 74: 00 00 00 00 <unknown> 154; OBJ-EMPTY: 155; OBJ-NEXT: 00000078 (idx: 18) f&o[DS]: 156; OBJ-NEXT: 78: 00 00 00 30 <unknown> 157; OBJ-NEXT: 00000078: R_POS (idx: 8) .f&o 158; OBJ-NEXT: 7c: 00 00 00 90 <unknown> 159; OBJ-NEXT: 0000007c: R_POS (idx: 22) TOC[TC0] 160; OBJ-NEXT: 80: 00 00 00 00 <unknown> 161; OBJ-EMPTY: 162; OBJ-NEXT: 00000084 (idx: 20) f&_o[DS]: 163; OBJ-NEXT: 84: 00 00 00 60 <unknown> 164; OBJ-NEXT: 00000084: R_POS (idx: 10) .f&_o 165; OBJ-NEXT: 88: 00 00 00 90 <unknown> 166; OBJ-NEXT: 00000088: R_POS (idx: 22) TOC[TC0] 167; OBJ-NEXT: 8c: 00 00 00 00 <unknown> 168; OBJ-EMPTY: 169; OBJ-NEXT: 00000090 (idx: 24) f=o[TC]: 170; OBJ-NEXT: 90: 00 00 00 9c <unknown> 171; OBJ-NEXT: 00000090: R_POS (idx: 30) f=o[BS] 172; OBJ-EMPTY: 173; OBJ-NEXT: 00000094 (idx: 26) f@o[TC]: 174; OBJ-NEXT: 94: 00 00 00 00 <unknown> 175; OBJ-NEXT: 00000094: R_POS (idx: 2) f@o[DS] 176; OBJ-EMPTY: 177; OBJ-NEXT: Disassembly of section .bss: 178; OBJ-EMPTY: 179; OBJ-NEXT: 00000098 (idx: 28) f"o"[RW]: 180; OBJ-NEXT: ... 181; OBJ-EMPTY: 182; OBJ-NEXT: 0000009c (idx: 30) f=o[BS]: 183; OBJ-NEXT: ... 184