[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / test / tools / dsymutil / X86 / dwarf5.test
bloba37b4f3ba4c693a14d0e79381334d487e9a050af
1 Test DWARF5 support in dsymutil. Currently this still generates an empty dSYM.
3 $ cat dwarf5.c
4 __attribute__ ((optnone))
5 int foo() {
6   volatile i;
7   return i;
10 int main(int argc, char** argv) {
11   return foo();
14 $ clang -gdwarf-5 dwarf5.c -c -o dwarf5.o
15 $ clang dwarf5.o -o dwarf5.out
17 RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/dwarf5/dwarf5.out -o %t.dSYM 2>&1 | FileCheck %s --allow-empty
18 RUN: llvm-dwarfdump --verify %t.dSYM 2>&1 | FileCheck %s
19 CHECK-NOT: error:
21 RUN: llvm-dwarfdump %t.dSYM | FileCheck %s --check-prefix DWARF
22 DWARF: DW_TAG_compile_unit
23 DWARF:   DW_AT_producer    ("clang version 12.0.0
24 DWARF:   DW_AT_language    (DW_LANG_C99)
25 DWARF:   DW_AT_name        ("dwarf5.c")
26 DWARF:   DW_AT_LLVM_sysroot        ("/")
27 DWARF:   DW_AT_stmt_list   (0x00000000)
28 DWARF:   DW_AT_comp_dir    ("/private/tmp/dwarf5")
29 DWARF:   DW_AT_low_pc      (0x0000000100003f80)
30 DWARF:   DW_AT_high_pc     (0x0000000100003fb1)
31 DWARF:   DW_AT_addr_base   (0x00000008)
32 DWARF:   DW_TAG_subprogram
33 DWARF:     DW_AT_name      ("foo")
34 DWARF:     DW_AT_decl_file (0x00)
35 DWARF:     DW_AT_decl_line (2)
36 DWARF:     DW_AT_type      (0x00000091 "int")
37 DWARF:     DW_AT_external  (true)
38 DWARF:     DW_TAG_variable
39 DWARF:       DW_AT_name    ("i")
40 DWARF:       DW_AT_decl_file       (0x00)
41 DWARF:       DW_AT_decl_line       (3)
42 DWARF:       DW_AT_type    (0x00000098 "volatile int")
43 DWARF:   DW_TAG_subprogram
44 DWARF:     DW_AT_name      ("main")
45 DWARF:     DW_AT_decl_file (0x00)
46 DWARF:     DW_AT_decl_line (7)
47 DWARF:     DW_AT_prototyped        (true)
48 DWARF:     DW_AT_type      (0x00000091 "int")
49 DWARF:     DW_AT_external  (true)
50 DWARF:     DW_TAG_formal_parameter
51 DWARF:       DW_AT_name    ("argc")
52 DWARF:       DW_AT_decl_file       (0x00)
53 DWARF:       DW_AT_decl_line       (7)
54 DWARF:       DW_AT_type    (0x00000091 "int")
55 DWARF:     DW_TAG_formal_parameter
56 DWARF:       DW_AT_name    ("argv")
57 DWARF:       DW_AT_decl_file       (0x00)
58 DWARF:       DW_AT_decl_line       (7)
59 DWARF:       DW_AT_type    (0x0000009d "char **")