• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -global-isel -mtriple=aarch64 %s -stop-after=irtranslator -o - | FileCheck %s
2; RUN: llc -mtriple=aarch64 -global-isel --global-isel-abort=0 -o /dev/null
3
4; CHECK-LABEL: name: debug_declare
5; CHECK: stack:
6; CHECK:    - { id: {{.*}}, name: in.addr, type: default, offset: 0, size: {{.*}}, alignment: {{.*}},
7; CHECK-NEXT: callee-saved-register: '', callee-saved-restored: true,
8; CHECK-NEXT: debug-info-variable: '!11', debug-info-expression: '!DIExpression()',
9; CHECK: DBG_VALUE debug-use %0(s32), debug-use $noreg, !11, !DIExpression(), debug-location !12
10define void @debug_declare(i32 %in) #0 !dbg !7 {
11entry:
12  %in.addr = alloca i32, align 4
13  store i32 %in, i32* %in.addr, align 4
14  call void @llvm.dbg.declare(metadata i32* %in.addr, metadata !11, metadata !DIExpression()), !dbg !12
15  call void @llvm.dbg.declare(metadata i32 %in, metadata !11, metadata !DIExpression()), !dbg !12
16  ret void, !dbg !12
17}
18
19; CHECK-LABEL: name: debug_declare_vla
20; CHECK: DBG_VALUE debug-use %{{[0-9]+}}(p0), debug-use $noreg, !14, !DIExpression(), debug-location !15
21define void @debug_declare_vla(i32 %in) #0 !dbg !13 {
22entry:
23  %vla.addr = alloca i32, i32 %in
24  call void @llvm.dbg.declare(metadata i32* %vla.addr, metadata !14, metadata !DIExpression()), !dbg !15
25  ret void, !dbg !15
26}
27
28; CHECK-LABEL: name: debug_value
29; CHECK: [[IN:%[0-9]+]]:_(s32) = COPY $w0
30define void @debug_value(i32 %in) #0 !dbg !16 {
31  %addr = alloca i32
32; CHECK: DBG_VALUE debug-use [[IN]](s32), debug-use $noreg, !17, !DIExpression(), debug-location !18
33  call void @llvm.dbg.value(metadata i32 %in, i64 0, metadata !17, metadata !DIExpression()), !dbg !18
34  store i32 %in, i32* %addr
35; CHECK: DBG_VALUE debug-use %1(p0), debug-use $noreg, !17, !DIExpression(DW_OP_deref), debug-location !18
36  call void @llvm.dbg.value(metadata i32* %addr, i64 0, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !18
37; CHECK: DBG_VALUE 123, 0, !17, !DIExpression(), debug-location !18
38  call void @llvm.dbg.value(metadata i32 123, i64 0, metadata !17, metadata !DIExpression()), !dbg !18
39; CHECK: DBG_VALUE float 1.000000e+00, 0, !17, !DIExpression(), debug-location !18
40  call void @llvm.dbg.value(metadata float 1.000000e+00, i64 0, metadata !17, metadata !DIExpression()), !dbg !18
41; CHECK: DBG_VALUE $noreg, 0, !17, !DIExpression(), debug-location !18
42  call void @llvm.dbg.value(metadata i32* null, i64 0, metadata !17, metadata !DIExpression()), !dbg !18
43  ret void
44}
45
46; Function Attrs: nounwind readnone
47declare void @llvm.dbg.declare(metadata, metadata, metadata)
48declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
49
50!llvm.dbg.cu = !{!0}
51!llvm.module.flags = !{!3, !4, !5}
52!llvm.ident = !{!6}
53
54!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 289075) (llvm/trunk 289080)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
55!1 = !DIFile(filename: "tmp.c", directory: "/Users/tim/llvm/build")
56!2 = !{}
57!3 = !{i32 2, !"Dwarf Version", i32 4}
58!4 = !{i32 2, !"Debug Info Version", i32 3}
59!5 = !{i32 1, !"PIC Level", i32 2}
60!6 = !{!"clang version 4.0.0 (trunk 289075) (llvm/trunk 289080)"}
61!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
62!8 = !DISubroutineType(types: !9)
63!9 = !{null, !10}
64!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
65!11 = !DILocalVariable(name: "in", arg: 1, scope: !7, file: !1, line: 1, type: !10)
66!12 = !DILocation(line: 1, column: 14, scope: !7)
67!13 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
68!14 = !DILocalVariable(name: "in", arg: 1, scope: !13, file: !1, line: 1, type: !10)
69!15 = !DILocation(line: 1, column: 14, scope: !13)
70!16 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
71!17 = !DILocalVariable(name: "in", arg: 1, scope: !16, file: !1, line: 1, type: !10)
72!18 = !DILocation(line: 1, column: 14, scope: !16)
73