1 ; Test the --syms option for xcoff object files.
2 ; Also test the --symbol-description option for xcoff object files, when specified with --syms.
3 ; RUN: llc -mtriple powerpc-ibm-aix -mcpu=pwr4 -filetype=obj -o %t.o < %s
4 ; RUN: llvm-objdump --syms %t.o | FileCheck --check-prefix=SYM %s
5 ; RUN: llvm-objdump --syms --symbol-description %t.o | FileCheck --check-prefix=SYM-DES %s
7 ;; The IR below is generated by the following source code.
9 ;; const char* con= "Test for --symbols";
17 ;; int bar(const char *v) {
19 ;; return (int)v[0] + (int)v[2] + si + ei;
26 ;; __attribute__ ((weak)) int wi=2;
29 @.str = private unnamed_addr constant [19 x i8] c"Test for --symbols\00", align 1
30 @con = global i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i32 0, i32 0), align 4
31 @si = internal global i32 0, align 4
32 @ei = external global i32, align 4
33 @wi = weak global i32 2, align 4
34 @i = global i32 0, align 4
35 @c = global i8 0, align 1
36 @ap = global i8* null, align 4
37 @f = global float 0.000000e+00, align 4
38 @ll = global i64 0, align 8
40 define i32 @bar(i8* %v) {
42 %v.addr = alloca i8*, align 4
43 store i8* %v, i8** %v.addr, align 4
44 store i32 1, i32* @si, align 4
45 %0 = load i8*, i8** %v.addr, align 4
46 %arrayidx = getelementptr inbounds i8, i8* %0, i32 0
47 %1 = load i8, i8* %arrayidx, align 1
48 %conv = zext i8 %1 to i32
49 %2 = load i8*, i8** %v.addr, align 4
50 %arrayidx1 = getelementptr inbounds i8, i8* %2, i32 2
51 %3 = load i8, i8* %arrayidx1, align 1
52 %conv2 = zext i8 %3 to i32
53 %add = add nsw i32 %conv, %conv2
54 %4 = load i32, i32* @si, align 4
55 %add3 = add nsw i32 %add, %4
56 %5 = load i32, i32* @ei, align 4
57 %add4 = add nsw i32 %add3, %5
63 %0 = load i8*, i8** @con, align 4
64 %call = call i32 @bar(i8* %0)
69 ; SYM-NEXT: 00000000 df *DEBUG* 00000000 <stdin>
70 ; SYM-NEXT: 00000000 *UND* 00000000 ei
71 ; SYM-NEXT: 00000000 l .text 00000091
72 ; SYM-NEXT: 00000000 g F .text (csect: ) 00000000 .bar
73 ; SYM-NEXT: 00000050 g F .text (csect: ) 00000000 .foo
74 ; SYM-NEXT: 00000094 l .text 00000013 L...str
75 ; SYM-NEXT: 000000a8 g O .data 00000004 con
76 ; SYM-NEXT: 000000ac w O .data 00000004 wi
77 ; SYM-NEXT: 000000b0 g O .data 00000004 i
78 ; SYM-NEXT: 000000b4 g O .data 00000001 c
79 ; SYM-NEXT: 000000b8 g O .data 00000004 ap
80 ; SYM-NEXT: 000000bc g O .data 00000004 f
81 ; SYM-NEXT: 000000c0 g O .data 00000008 ll
82 ; SYM-NEXT: 000000c8 g O .data 0000000c bar
83 ; SYM-NEXT: 000000d4 g O .data 0000000c foo
84 ; SYM-NEXT: 000000e0 l .data 00000000 TOC
85 ; SYM-NEXT: 000000e0 l O .data 00000004 si
86 ; SYM-NEXT: 000000e4 l O .data 00000004 ei
87 ; SYM-NEXT: 000000e8 l O .data 00000004 con
88 ; SYM-NEXT: 000000ec l O *COM* 00000004 si
90 ; SYM-DES: SYMBOL TABLE:
91 ; SYM-DES-NEXT: 00000000 df *DEBUG* 00000000 (idx: 0) <stdin>
92 ; SYM-DES-NEXT: 00000000 *UND* 00000000 (idx: 1) ei[UA]
93 ; SYM-DES-NEXT: 00000000 l .text 00000091 (idx: 3) [PR]
94 ; SYM-DES-NEXT: 00000000 g F .text (csect: (idx: 3) [PR]) 00000000 (idx: 5) .bar
95 ; SYM-DES-NEXT: 00000050 g F .text (csect: (idx: 3) [PR]) 00000000 (idx: 7) .foo
96 ; SYM-DES-NEXT: 00000094 l .text 00000013 (idx: 9) L...str[RO]
97 ; SYM-DES-NEXT: 000000a8 g O .data 00000004 (idx: 11) con[RW]
98 ; SYM-DES-NEXT: 000000ac w O .data 00000004 (idx: 13) wi[RW]
99 ; SYM-DES-NEXT: 000000b0 g O .data 00000004 (idx: 15) i[RW]
100 ; SYM-DES-NEXT: 000000b4 g O .data 00000001 (idx: 17) c[RW]
101 ; SYM-DES-NEXT: 000000b8 g O .data 00000004 (idx: 19) ap[RW]
102 ; SYM-DES-NEXT: 000000bc g O .data 00000004 (idx: 21) f[RW]
103 ; SYM-DES-NEXT: 000000c0 g O .data 00000008 (idx: 23) ll[RW]
104 ; SYM-DES-NEXT: 000000c8 g O .data 0000000c (idx: 25) bar[DS]
105 ; SYM-DES-NEXT: 000000d4 g O .data 0000000c (idx: 27) foo[DS]
106 ; SYM-DES-NEXT: 000000e0 l .data 00000000 (idx: 29) TOC[TC0]
107 ; SYM-DES-NEXT: 000000e0 l O .data 00000004 (idx: 31) si[TC]
108 ; SYM-DES-NEXT: 000000e4 l O .data 00000004 (idx: 33) ei[TC]
109 ; SYM-DES-NEXT: 000000e8 l O .data 00000004 (idx: 35) con[TC]
110 ; SYM-DES-NEXT: 000000ec l O *COM* 00000004 (idx: 37) si[BS]