150a3ff30SFangrui Song# RUN: llc -mtriple=aarch64 -run-pass=patchable-function %s -o - | FileCheck %s
250a3ff30SFangrui Song
35932f7b8SFangrui Song## The initial .loc covers PATCHABLE_FUNCTION_ENTER.
45932f7b8SFangrui Song## Emitting a new .loc may create a prologue_end prematurely.
550a3ff30SFangrui Song# CHECK:    name: empty
650a3ff30SFangrui Song# CHECK:    bb.0.entry
750a3ff30SFangrui Song# CHECK:      PATCHABLE_FUNCTION_ENTER{{$}}
8*f71350f0SDaniel Sanders# CHECK-NEXT: RET undef $lr, debug-location !9
950a3ff30SFangrui Song
1050a3ff30SFangrui Song--- |
11*f71350f0SDaniel Sanders  define void @empty() #0 !dbg !6 {
1250a3ff30SFangrui Song  entry:
13*f71350f0SDaniel Sanders    ret void, !dbg !9
1450a3ff30SFangrui Song  }
1550a3ff30SFangrui Song
1650a3ff30SFangrui Song  attributes #0 = { "patchable-function-entry"="1" }
1750a3ff30SFangrui Song  !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
1850a3ff30SFangrui Song  !1 = !DIFile(filename: "a.c", directory: "/tmp")
1950a3ff30SFangrui Song  !2 = !{}
2050a3ff30SFangrui Song  !3 = !{i32 7, !"Dwarf Version", i32 4}
2150a3ff30SFangrui Song  !4 = !{i32 2, !"Debug Info Version", i32 3}
2250a3ff30SFangrui Song  !5 = !{i32 1, !"wchar_size", i32 4}
23*f71350f0SDaniel Sanders  !6 = distinct !DISubprogram(name: "empty", scope: !1, file: !1, line: 1, type: !7, scopeLine: 1, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
24*f71350f0SDaniel Sanders  !7 = !DISubroutineType(types: !8)
25*f71350f0SDaniel Sanders  !8 = !{null}
26*f71350f0SDaniel Sanders  !9 = !DILocation(line: 1, column: 61, scope: !6)
27*f71350f0SDaniel Sanders  !llvm.dbg.cu = !{!0}
28*f71350f0SDaniel Sanders  !llvm.module.flags = !{!3, !4, !5}
2950a3ff30SFangrui Song
3050a3ff30SFangrui Song...
3150a3ff30SFangrui Song---
3250a3ff30SFangrui Songname:            empty
3350a3ff30SFangrui Songalignment:       4
3450a3ff30SFangrui SongtracksRegLiveness: true
3550a3ff30SFangrui Songbody:             |
3650a3ff30SFangrui Song  bb.0.entry:
3750a3ff30SFangrui Song    liveins: $lr
38*f71350f0SDaniel Sanders    RET undef $lr, debug-location !9
3950a3ff30SFangrui Song
4050a3ff30SFangrui Song...
41