xref: /llvm-project/llvm/test/Object/nm-universal-binary.test (revision bef2592c092f453078d8762d6d3d9c811f23c25d)
1RUN: llvm-nm --arch=all %p/Inputs/macho-universal.x86_64.i386 \
2RUN:         | FileCheck %s -check-prefix CHECK-OBJ
3RUN: llvm-nm --arch=all %p/Inputs/macho-universal64.x86_64.i386 \
4RUN:         | FileCheck %s -check-prefix CHECK-64-OBJ
5RUN: llvm-nm --arch=x86_64 %p/Inputs/macho-universal.x86_64.i386 \
6RUN:         | FileCheck %s -check-prefix CHECK-OBJ-x86_64
7RUN: not llvm-nm --arch=armv7m %p/Inputs/macho-universal.x86_64.i386 2>&1 \
8RUN:         | FileCheck %s --check-prefix=CHECK-OBJ-armv7m --implicit-check-not=error:
9RUN: not llvm-nm --arch=foobar %p/Inputs/macho-universal.x86_64.i386 2>&1 \
10RUN:         | FileCheck %s --check-prefix=CHECK-OBJ-foobar --implicit-check-not=error:
11RUN: llvm-nm --arch=all %p/Inputs/macho-universal-archive.x86_64.i386 \
12RUN:         | FileCheck %s -check-prefix CHECK-AR
13RUN: llvm-nm --arch=all %p/Inputs/macho-universal64-archive.x86_64.i386 \
14RUN:         | FileCheck %s -check-prefix CHECK-64-AR
15RUN: llvm-nm --arch=i386 %p/Inputs/macho-universal-archive.x86_64.i386 \
16RUN:         | FileCheck %s -check-prefix CHECK-AR-i386
17RUN: llvm-nm -o --arch=all %p/Inputs/macho-universal-archive.x86_64.i386 \
18RUN:         | FileCheck %s -check-prefix CHECK-AR-o
19
20CHECK-OBJ: macho-universal.x86_64.i386 (for architecture x86_64):
21CHECK-OBJ: 0000000100000f60 T _main
22CHECK-OBJ: macho-universal.x86_64.i386 (for architecture i386):
23CHECK-OBJ: 00001fa0 T _main
24
25CHECK-64-OBJ: macho-universal64.x86_64.i386 (for architecture x86_64):
26CHECK-64-OBJ: 0000000100000f60 T _main
27CHECK-64-OBJ: macho-universal64.x86_64.i386 (for architecture i386):
28CHECK-64-OBJ: 00001fa0 T _main
29
30CHECK-OBJ-x86_64: 0000000100000000 T __mh_execute_header
31CHECK-OBJ-x86_64: 0000000100000f60 T _main
32CHECK-OBJ-x86_64:                  U dyld_stub_binder
33
34CHECK-OBJ-armv7m: error: file: {{.*}} does not contain architecture
35
36CHECK-OBJ-foobar: error: for the --arch option: Unknown architecture named 'foobar'
37
38CHECK-AR:       {{^$}}
39CHECK-AR-NEXT:  macho-universal-archive.x86_64.i386(hello.o) (for architecture x86_64):
40CHECK-AR:       0000000000000068 s EH_frame0
41CHECK-AR:       000000000000003b s L_.str
42CHECK-AR:       0000000000000000 T _main
43CHECK-AR:       0000000000000080 S _main.eh
44CHECK-AR:                        U _printf
45CHECK-AR: macho-universal-archive.x86_64.i386(foo.o) (for architecture i386):
46CHECK-AR: 00000008 D _bar
47CHECK-AR: 00000000 T _foo
48
49CHECK-64-AR:      {{^$}}
50CHECK-64-AR-NEXT: macho-universal64-archive.x86_64.i386(foo.o) (for architecture i386):
51CHECK-64-AR:      00000008 D _bar
52CHECK-64-AR:      00000000 T _foo
53CHECK-64-AR:      macho-universal64-archive.x86_64.i386(hello.o) (for architecture x86_64):
54CHECK-64-AR:      0000000000000068 s EH_frame0
55CHECK-64-AR:      000000000000003b s L_.str
56CHECK-64-AR:      0000000000000000 T _main
57CHECK-64-AR:      0000000000000080 S _main.eh
58CHECK-64-AR:                       U _printf
59
60CHECK-AR-i386: macho-universal-archive.x86_64.i386(foo.o):
61CHECK-AR-i386: 00000008 D _bar
62CHECK-AR-i386: 00000000 T _foo
63
64CHECK-AR-o: (for architecture x86_64):{{.*}}/macho-universal-archive.x86_64.i386:hello.o: 0000000000000068 s EH_frame0
65CHECK-AR-o: (for architecture x86_64):{{.*}}/macho-universal-archive.x86_64.i386:hello.o: 000000000000003b s L_.str
66CHECK-AR-o: (for architecture x86_64):{{.*}}/macho-universal-archive.x86_64.i386:hello.o: 0000000000000000 T _main
67CHECK-AR-o: (for architecture x86_64):{{.*}}/macho-universal-archive.x86_64.i386:hello.o: 0000000000000080 S _main.eh
68CHECK-AR-o: (for architecture x86_64):{{.*}}/macho-universal-archive.x86_64.i386:hello.o:                  U _printf
69CHECK-AR-o: (for architecture i386):{{.*}}/macho-universal-archive.x86_64.i386:foo.o: 00000008 D _bar
70CHECK-AR-o: (for architecture i386):{{.*}}/macho-universal-archive.x86_64.i386:foo.o: 00000000 T _foo
71