Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / tools / dsymutil / X86 / global_downgraded_to_static.c
blob28910cb0d341473ab162ef7b074d5bafc1310ada
1 // REQUIRES : system-darwin
2 // RUN: dsymutil -oso-prepend-path %p/.. -dump-debug-map \
3 // RUN: %p/../Inputs/global_downgraded_to_static.x86_64 2>&1 | FileCheck %s
4 //
5 // RUN: dsymutil --linker llvm -oso-prepend-path %p/.. -dump-debug-map \
6 // RUN: %p/../Inputs/global_downgraded_to_static.x86_64 2>&1 | FileCheck %s
7 //
8 // To build:
9 // clang -g -c -DFILE1 global_downgraded_to_static.c -o 1.o
10 // clang -g -c -DFILE2 global_downgraded_to_static.c -o 2.o
11 // ld -r -exported_symbol _foo 1.o -o 1.r.o
12 // clang 1.r.o 2.o -o global_downgraded_to_static.x86_64
14 #if defined(FILE1)
15 int global_to_become_static = 42;
16 // CHECK: sym: _global_to_become_static,
17 // CHECK-SAME: binAddr: 0x100001000
18 int foo() {
19 return global_to_become_static;
21 #elif defined(FILE2)
22 int foo(void);
23 int main() {
24 return foo();
26 #else
27 #error Define FILE1 or FILE2
28 #endif