1 # RUN: llc -mtriple=x86_64-unknown-windows-msvc -start-before=x86-flags-copy-lowering -o - %s | FileCheck %s
3 # Test the emission of heap alloc site instruction labels.
6 declare ptr @alloc(i32) nounwind
8 define i32 @test(i32 %x) nounwind !dbg !6 {
10 call ptr @alloc(i32 %x), !dbg !11, !heapallocsite !2
15 !llvm.module.flags = !{!3, !4, !5}
17 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
18 !1 = !DIFile(filename: "<stdin>", directory: "")
20 !3 = !{i32 2, !"CodeView", i32 1}
21 !4 = !{i32 2, !"Debug Info Version", i32 3}
22 !5 = !{i32 1, !"wchar_size", i32 2}
23 !6 = distinct !DISubprogram(name: "test", scope: !7, file: !7, line: 2, type: !8, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
24 !7 = !DIFile(filename: "test.c", directory: "")
25 !8 = !DISubroutineType(types: !9)
27 !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
28 !11 = !DILocation(line: 3, scope: !6)
29 !12 = !DILocation(line: 4, scope: !6)
34 # CHECK-LABEL: {{^}}test:
35 tracksRegLiveness: true
43 ADJCALLSTACKDOWN64 32, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp, debug-location !11
44 CALL64pcrel32 @alloc, csr_win64, implicit $rsp, implicit $ssp, implicit $ecx, implicit-def $rsp, implicit-def $ssp, implicit-def dead $rax, heap-alloc-marker !2, debug-location !11
46 ; CHECK-NEXT: .Ltmp{{.*}}:
47 ADJCALLSTACKUP64 32, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp, debug-location !11
48 $eax = MOV32r0 implicit-def dead $eflags, debug-location !12
49 RET 0, killed $eax, debug-location !12