Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/Generic/multiline.ll

raw
1 ; RUN: llvm-as < %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -o %t.spv
3 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.ll
4
5 ; RUN: llc -mtriple=%triple -filetype=asm -asm-verbose=0 -O0 < %t.ll | FileCheck %s
6 ; RUN: llc -mtriple=%triple -filetype=obj -O0 < %t.ll | llvm-dwarfdump -debug-line - | FileCheck %s --check-prefix=INT
7
8 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
9 target triple = "spir64-unknown-unknown"
10
11 ; Check that the assembly output properly handles is_stmt changes. And since
12 ; we're testing anyway, check the integrated assembler too.
13
14 ; Generated with clang from multiline.c:
15 ; void f1();
16 ; void f2() {
17 ; f1(); f1(); f1();
18 ; f1(); f1(); f1();
19 ; }
20
21
22 ; CHECK: .loc 1 2 0{{$}}
23 ; CHECK-NOT: .loc{{ }}
24 ; CHECK: .loc 1 3 3 prologue_end{{$}}
25 ; CHECK-NOT: .loc
26 ; CHECK: .loc 1 3 9 is_stmt 0{{$}}
27 ; CHECK-NOT: .loc
28 ; CHECK: .loc 1 3 15{{$}}
29 ; CHECK-NOT: .loc
30 ; CHECK: .loc 1 4 3 is_stmt 1{{$}}
31 ; CHECK-NOT: .loc
32 ; CHECK: .loc 1 4 9 is_stmt 0{{$}}
33 ; CHECK-NOT: .loc
34 ; CHECK: .loc 1 4 15{{$}}
35 ; CHECK-NOT: .loc
36 ; CHECK: .loc 1 5 1 {{(epilogue_begin )?}}is_stmt 1{{$}}
37
38 ; INT: {{^}}Address
39 ; INT: -----
40 ; INT-NEXT: 2 0 1 0 0 is_stmt{{$}}
41 ; INT-NEXT: 3 3 1 0 0 is_stmt prologue_end{{$}}
42 ; INT-NEXT: 3 9 1 0 0 {{$}}
43 ; INT-NEXT: 3 15 1 0 0 {{$}}
44 ; INT-NEXT: 4 3 1 0 0 is_stmt{{$}}
45 ; INT-NEXT: 4 9 1 0 0 {{$}}
46 ; INT-NEXT: 4 15 1 0 0 {{$}}
47 ; INT-NEXT: 5 1 1 0 0 is_stmt{{( epilogue_begin)?}}{{$}}
48
49
50 ; Function Attrs: nounwind uwtable
51 define void @f2() #0 !dbg !4 {
52 entry:
53 call void (...) @f1(), !dbg !11
54 call void (...) @f1(), !dbg !12
55 call void (...) @f1(), !dbg !13
56 call void (...) @f1(), !dbg !14
57 call void (...) @f1(), !dbg !15
58 call void (...) @f1(), !dbg !16
59 ret void, !dbg !17
60 }
61
62 declare void @f1(...) #1
63
64 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
65 attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
66
67 !llvm.dbg.cu = !{!0}
68 !llvm.module.flags = !{!8, !9}
69 !llvm.ident = !{!10}
70
71 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 (trunk 225000) (llvm/trunk 224999)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
72 !1 = !DIFile(filename: "multiline.c", directory: "/tmp/dbginfo")
73 !2 = !{}
74 !4 = distinct !DISubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, retainedNodes: !2)
75 !5 = !DIFile(filename: "multiline.c", directory: "/tmp/dbginfo")
76 !6 = !DISubroutineType(types: !7)
77 !7 = !{null}
78 !8 = !{i32 2, !"Dwarf Version", i32 4}
79 !9 = !{i32 2, !"Debug Info Version", i32 3}
80 !10 = !{!"clang version 3.6.0 (trunk 225000) (llvm/trunk 224999)"}
81 !11 = !DILocation(line: 3, column: 3, scope: !4)
82 !12 = !DILocation(line: 3, column: 9, scope: !4)
83 !13 = !DILocation(line: 3, column: 15, scope: !4)
84 !14 = !DILocation(line: 4, column: 3, scope: !4)
85 !15 = !DILocation(line: 4, column: 9, scope: !4)
86 !16 = !DILocation(line: 4, column: 15, scope: !4)
87 !17 = !DILocation(line: 5, column: 1, scope: !4)