[Instrumentation] Fix a warning
[llvm-project.git] / llvm / test / tools / llvm-symbolizer / functions.s
blob953760ac24af90140d30f9520d384ba6f406c991
1 # REQUIRES: x86-registered-target
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
5 # RUN: llvm-symbolizer 0 --obj=%t.o | FileCheck %s --check-prefix=LINKAGE
6 # RUN: llvm-symbolizer 0 -f --obj=%t.o | FileCheck %s --check-prefix=LINKAGE
7 # RUN: llvm-symbolizer 0 --functions --obj=%t.o | FileCheck %s --check-prefix=LINKAGE
8 # RUN: llvm-symbolizer 0 -f=linkage --obj=%t.o | FileCheck %s --check-prefix=LINKAGE
9 # RUN: llvm-symbolizer 0 --functions=linkage --obj=%t.o | FileCheck %s --check-prefix=LINKAGE
10 # RUN: llvm-symbolizer 0 -f=short --obj=%t.o | FileCheck %s --check-prefix=SHORT
11 # RUN: llvm-symbolizer 0 --functions=short --obj=%t.o | FileCheck %s --check-prefix=SHORT
12 # RUN: llvm-symbolizer 0 -f=none --obj=%t.o | FileCheck %s --check-prefix=NONE
13 # RUN: llvm-symbolizer 0 --functions=none --obj=%t.o | FileCheck %s --check-prefix=NONE
15 ## Characterise behaviour for no '=' sign. llvm-symbolizer treats the next option as an
16 ## input address, and just prints it.
17 # RUN: llvm-symbolizer 0 -f none --obj=%t.o | FileCheck %s --check-prefixes=LINKAGE,ERR
18 # RUN: llvm-symbolizer 0 --functions none --obj=%t.o | FileCheck %s --check-prefixes=LINKAGE,ERR
20 # LINKAGE: {{^}}foo(int){{$}}
21 # LINKAGE-NEXT: functions.cpp:2:0
23 # SHORT: {{^}}foo{{$}}
24 # SHORT-NEXT: functions.cpp:2:0
26 # NONE-NOT: foo
27 # NONE: functions.cpp:2:0
29 # ERR: ??
30 # ERR-NEXT: ??:0
32 # The assembly below is a stripped down version of the output of:
33 # clang -S -g --target=x86_64-pc-linux
34 # for the following C++ source:
35 # void foo(int bar) {}
36 .type _Z3fooi,@function
37 _Z3fooi:
38 .Lfunc_begin0:
39 .file 1 "/llvm-symbolizer/Inputs" "functions.cpp"
40 .loc 1 2 0 # functions.cpp:2:0
41 nop
42 .loc 1 2 20 prologue_end # functions.cpp:2:20
43 .Lfunc_end0:
45 .section .debug_str,"MS",@progbits,1
46 .Linfo_string1:
47 .asciz "functions.cpp"
48 .Linfo_string2:
49 .asciz "/llvm-symbolizer/Inputs"
50 .Linfo_string3:
51 .asciz "_Z3fooi"
52 .Linfo_string4:
53 .asciz "foo"
55 .section .debug_abbrev,"",@progbits
56 .byte 1 # Abbreviation Code
57 .byte 17 # DW_TAG_compile_unit
58 .byte 1 # DW_CHILDREN_yes
59 .byte 3 # DW_AT_name
60 .byte 14 # DW_FORM_strp
61 .byte 16 # DW_AT_stmt_list
62 .byte 23 # DW_FORM_sec_offset
63 .byte 27 # DW_AT_comp_dir
64 .byte 14 # DW_FORM_strp
65 .byte 17 # DW_AT_low_pc
66 .byte 1 # DW_FORM_addr
67 .byte 18 # DW_AT_high_pc
68 .byte 6 # DW_FORM_data4
69 .byte 0 # EOM(1)
70 .byte 0 # EOM(2)
71 .byte 2 # Abbreviation Code
72 .byte 46 # DW_TAG_subprogram
73 .byte 0 # DW_CHILDREN_no
74 .byte 17 # DW_AT_low_pc
75 .byte 1 # DW_FORM_addr
76 .byte 18 # DW_AT_high_pc
77 .byte 6 # DW_FORM_data4
78 .byte 110 # DW_AT_linkage_name
79 .byte 14 # DW_FORM_strp
80 .byte 3 # DW_AT_name
81 .byte 14 # DW_FORM_strp
82 .byte 58 # DW_AT_decl_file
83 .byte 11 # DW_FORM_data1
84 .byte 59 # DW_AT_decl_line
85 .byte 11 # DW_FORM_data1
86 .byte 0 # EOM(1)
87 .byte 0 # EOM(2)
88 .byte 0 # EOM(3)
90 .section .debug_info,"",@progbits
91 .Lcu_begin0:
92 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
93 .Ldebug_info_start0:
94 .short 4 # DWARF version number
95 .long .debug_abbrev # Offset Into Abbrev. Section
96 .byte 8 # Address Size (in bytes)
97 .byte 1 # Abbrev [1] 0xb:0x4f DW_TAG_compile_unit
98 .long .Linfo_string1 # DW_AT_name
99 .long .Lline_table_start0 # DW_AT_stmt_list
100 .long .Linfo_string2 # DW_AT_comp_dir
101 .quad .Lfunc_begin0 # DW_AT_low_pc
102 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
103 .byte 2 # Abbrev [2] 0x2a:0x28 DW_TAG_subprogram
104 .quad .Lfunc_begin0 # DW_AT_low_pc
105 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
106 .long .Linfo_string3 # DW_AT_linkage_name
107 .long .Linfo_string4 # DW_AT_name
108 .byte 1 # DW_AT_decl_file
109 .byte 2 # DW_AT_decl_line
110 .byte 0 # End Of Children Mark
111 .byte 0 # End Of Children Mark
112 .Ldebug_info_end0:
114 .section .debug_line,"",@progbits
115 .Lline_table_start0: