|
1 | 1 | ; RUN: llc -filetype=asm %s -o - -mtriple arm64-apple-ios -addrsig | FileCheck %s
|
2 | 2 | ; RUN: llc -filetype=obj %s -o %t -mtriple arm64-apple-ios -addrsig
|
3 |
| -; RUN: llvm-readobj --hex-dump='__llvm_addrsig' %t | FileCheck %s --check-prefix=OBJ |
| 3 | +; RUN: llvm-objdump --macho --section-headers %t | FileCheck %s --check-prefix=SECTIONS |
| 4 | +; RUN: llvm-objdump --macho --reloc %t | FileCheck %s --check-prefix=RELOCS |
4 | 5 |
|
5 | 6 | ; CHECK: .addrsig{{$}}
|
6 | 7 | ; CHECK-NEXT: .addrsig_sym _func03_takeaddr
|
|
11 | 12 | ; CHECK-NEXT: .addrsig_sym _a1
|
12 | 13 | ; CHECK-NEXT: .addrsig_sym _i1
|
13 | 14 |
|
14 |
| -; OBJ: Hex dump of section '__llvm_addrsig': |
15 |
| -; OBJ-NEXT:0x{{[0-9a-f]*}} |
| 15 | +; The __debug_line section (which should be generated for the given input file) |
| 16 | +; should appear immediately after the addrsig section. Use it to make sure |
| 17 | +; addrsig's section size has been properly set during section layout. This |
| 18 | +; catches a regression where the next section would overlap addrsig's |
| 19 | +; contents. |
| 20 | +; SECTIONS: __llvm_addrsig 00000008 [[#%.16x,ADDR:]] |
| 21 | +; SECTIONS-NEXT: __debug_line {{[[:xdigit:]]+}} [[#%.16x,8+ADDR]] |
| 22 | + |
| 23 | +; RELOCS: Relocation information (__DATA,__llvm_addrsig) 7 entries |
| 24 | +; RELOCS: address pcrel length extern type scattered symbolnum/value |
| 25 | +; RELOCS: 00000000 False ?( 3) True UNSIGND False _i1 |
| 26 | +; RELOCS: 00000000 False ?( 3) True UNSIGND False _a1 |
| 27 | +; RELOCS: 00000000 False ?( 3) True UNSIGND False _g1 |
| 28 | +; RELOCS: 00000000 False ?( 3) True UNSIGND False _result |
| 29 | +; RELOCS: 00000000 False ?( 3) True UNSIGND False _metadata_f2 |
| 30 | +; RELOCS: 00000000 False ?( 3) True UNSIGND False _f1 |
| 31 | +; RELOCS: 00000000 False ?( 3) True UNSIGND False _func03_takeaddr |
16 | 32 |
|
17 | 33 | target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
|
18 | 34 | target triple = "arm64-apple-ios7.0.0"
|
|
38 | 54 | }
|
39 | 55 |
|
40 | 56 | ; Function Attrs: minsize nofree noinline norecurse nounwind optsize ssp uwtable
|
41 |
| -define void @func03_takeaddr() #0 { |
| 57 | +define void @func03_takeaddr() #0 !dbg !9 { |
42 | 58 | entry:
|
43 | 59 | %0 = load volatile i32, ptr @result, align 4
|
44 | 60 | %add = add nsw i32 %0, 1
|
@@ -72,8 +88,8 @@ define void()* @f1() {
|
72 | 88 | %a2 = bitcast i32* @a2 to i8*
|
73 | 89 | %i1 = bitcast void()* @i1 to i8*
|
74 | 90 | %i2 = bitcast void()* @i2 to i8*
|
75 |
| - call void @llvm.dbg.value(metadata i8* bitcast (void()* @metadata_f1 to i8*), metadata !5, metadata !DIExpression()), !dbg !7 |
76 |
| - call void @llvm.dbg.value(metadata i8* bitcast (void()* @metadata_f2 to i8*), metadata !5, metadata !DIExpression()), !dbg !7 |
| 91 | + call void @llvm.dbg.value(metadata i8* bitcast (void()* @metadata_f1 to i8*), metadata !6, metadata !DIExpression()), !dbg !8 |
| 92 | + call void @llvm.dbg.value(metadata i8* bitcast (void()* @metadata_f2 to i8*), metadata !6, metadata !DIExpression()), !dbg !8 |
77 | 93 | call void @f4(i8* bitcast (void()* @metadata_f2 to i8*))
|
78 | 94 | unreachable
|
79 | 95 | }
|
@@ -108,9 +124,18 @@ declare void @f3() unnamed_addr
|
108 | 124 | declare void @llvm.dbg.value(metadata, metadata, metadata)
|
109 | 125 |
|
110 | 126 | attributes #0 = { noinline }
|
111 |
| - |
112 |
| -!3 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false) |
113 |
| -!4 = !DILocation(line: 0, scope: !3) |
114 |
| -!5 = !DILocalVariable(scope: !6) |
115 |
| -!6 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false) |
116 |
| -!7 = !DILocation(line: 0, scope: !6, inlinedAt: !4) |
| 127 | +!llvm.dbg.cu = !{!0} |
| 128 | +!llvm.module.flags = !{!2, !3} |
| 129 | + |
| 130 | +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, emissionKind: FullDebug) |
| 131 | +!1 = !DIFile(filename: "test.c", directory: "/tmp") |
| 132 | +!2 = !{i32 7, !"Dwarf Version", i32 4} |
| 133 | +!3 = !{i32 2, !"Debug Info Version", i32 3} |
| 134 | + |
| 135 | +!4 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false, unit: !0) |
| 136 | +!5 = !DILocation(line: 0, scope: !4) |
| 137 | +!6 = !DILocalVariable(scope: !7) |
| 138 | +!7 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false, unit: !0) |
| 139 | +!8 = !DILocation(line: 0, scope: !7, inlinedAt: !5) |
| 140 | +!9 = distinct !DISubprogram(scope: null, file: !1, line: 1, type: !10, unit: !0) |
| 141 | +!10 = !DISubroutineType(types: !{}) |
0 commit comments