| 1 |
RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/common/common.x86_64 -f -o - | llvm-dwarfdump -debug-info - | FileCheck %s |
| 2 |
RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/common/common.x86_64 -dump-debug-map | FileCheck %s --check-prefix DEBUGMAP |
| 3 |
|
| 4 |
RUN: dsymutil --linker parallel -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/common/common.x86_64 -f -o - | llvm-dwarfdump -debug-info - | FileCheck %s |
| 5 |
RUN: dsymutil --linker parallel -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/common/common.x86_64 -dump-debug-map | FileCheck %s --check-prefix DEBUGMAP |
| 6 |
|
| 7 |
The test was compiled from two source files: |
| 8 |
$ cd /private/tmp/common |
| 9 |
$ cat common1.c |
| 10 |
int i[1000]; |
| 11 |
int main() { |
| 12 |
return i[1]; |
| 13 |
} |
| 14 |
$ cat common2.c |
| 15 |
extern int i[1000]; |
| 16 |
int bar() { |
| 17 |
return i[0]; |
| 18 |
} |
| 19 |
$ clang -fcommon -g -c common1.c -o common1.o |
| 20 |
$ clang -fcommon -g -c common2.c -o common2.o |
| 21 |
$ clang -fcommon -g common1.o common2.o -o common.x86_64 |
| 22 |
|
| 23 |
CHECK: DW_TAG_compile_unit |
| 24 |
CHECK: DW_TAG_variable |
| 25 |
CHECK-NOT: {{NULL|DW_TAG}} |
| 26 |
CHECK: DW_AT_name{{.*}}"i" |
| 27 |
CHECK-NOT: {{NULL|DW_TAG}} |
| 28 |
CHECK: DW_AT_location{{.*}}DW_OP_addr 0x100001000) |
| 29 |
|
| 30 |
CHECK: DW_TAG_compile_unit |
| 31 |
CHECK: DW_TAG_variable |
| 32 |
CHECK-NOT: {{NULL|DW_TAG}} |
| 33 |
CHECK: DW_AT_name{{.*}}"i" |
| 34 |
CHECK-NOT: {{NULL|DW_TAG}} |
| 35 |
CHECK: DW_AT_location{{.*}}DW_OP_addr 0x100001000) |
| 36 |
|
| 37 |
DEBUGMAP: filename:{{.*}}common1.o |
| 38 |
DEBUGMAP: symbols: |
| 39 |
DEBUGMAP: sym: _i, binAddr: 0x100001000, size: 0x0 |
| 40 |
DEBUGMAP: filename:{{.*}}common2.o |
| 41 |
DEBUGMAP: symbols: |
| 42 |
DEBUGMAP: sym: _i, binAddr: 0x100001000, size: 0x0 |