xref: /llvm-project/llvm/test/DebugInfo/dwarfdump-macho-relocs.test (revision 7bc1b28291d6fb60cd055c375a1a94fb6ba7c832)
1*7bc1b282SAdrian Prantl// RUN: llvm-dwarfdump -debug-info %p/Inputs/dwarfdump-macho-relocs.macho.x86_64.o | FileCheck %s
27bb12261SFrederic Riss
37bb12261SFrederic Riss// The dumped file has 2 functions in different sections of the __TEXT segment.
47bb12261SFrederic Riss// Check that the addresses are are dumped correctly
57bb12261SFrederic Riss
67bb12261SFrederic Riss// Compiled with: clang -x c -g -c -o dwarfdump-macho-relocs.macho.x86_64.o dwarfdump-macho-relocs.test
77bb12261SFrederic Riss
87bb12261SFrederic Riss__attribute__((section("__TEXT,__blah")))
97bb12261SFrederic Rissint foo() {
107bb12261SFrederic Riss        return 42;
117bb12261SFrederic Riss}
127bb12261SFrederic Riss
137bb12261SFrederic Riss// CHECK:  DW_TAG_subprogram
147bb12261SFrederic Riss// CHECK-NEXT:    DW_AT_low_pc{{.*}}0x0000000000000020
157bb12261SFrederic Riss// CHECK-NEXT:    DW_AT_high_pc{{.*}}0x000000000000002b
167bb12261SFrederic Riss// CHECK-NEXT:    DW_AT_frame_base
177bb12261SFrederic Riss// CHECK-NEXT:    DW_AT_name{{.*}}"foo"
187bb12261SFrederic Riss
197bb12261SFrederic Rissint main() {
207bb12261SFrederic Riss        return foo();
217bb12261SFrederic Riss}
227bb12261SFrederic Riss
237bb12261SFrederic Riss// CHECK:  DW_TAG_subprogram
247bb12261SFrederic Riss// CHECK-NEXT:    DW_AT_low_pc{{.*}}0x0000000000000000
257bb12261SFrederic Riss// CHECK-NEXT:    DW_AT_high_pc{{.*}}0x000000000000001a
267bb12261SFrederic Riss// CHECK-NEXT:    DW_AT_frame_base
277bb12261SFrederic Riss// CHECK-NEXT:    DW_AT_name{{.*}}"main"
28