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