xref: /aosp_15_r20/external/llvm/test/DebugInfo/COFF/tail-call-without-lexical-scopes.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; This LL file was generated by running clang on the following code:
4*9880d681SAndroid Build Coastguard Worker; D:\test.cpp:
5*9880d681SAndroid Build Coastguard Worker; 1 void foo();
6*9880d681SAndroid Build Coastguard Worker; 2
7*9880d681SAndroid Build Coastguard Worker; 3 static void bar(int arg, ...) {
8*9880d681SAndroid Build Coastguard Worker; 4   foo();
9*9880d681SAndroid Build Coastguard Worker; 5 }
10*9880d681SAndroid Build Coastguard Worker; 6
11*9880d681SAndroid Build Coastguard Worker; 7 void spam(void) {
12*9880d681SAndroid Build Coastguard Worker; 8   bar(42);
13*9880d681SAndroid Build Coastguard Worker; 9 }
14*9880d681SAndroid Build Coastguard Worker;
15*9880d681SAndroid Build Coastguard Worker; The bar function happens to have no lexical scopes, yet it has one instruction
16*9880d681SAndroid Build Coastguard Worker; with debug information available.  This used to be PR19239.
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker; X86:      .cv_file 1 "D:\\test.cpp"
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker; X86-LABEL: {{^}}"?bar@@YAXHZZ":
21*9880d681SAndroid Build Coastguard Worker; X86:      .cv_loc  1 1 4 0
22*9880d681SAndroid Build Coastguard Worker; X86:      jmp "?foo@@YAXXZ"
23*9880d681SAndroid Build Coastguard Worker; X86:      [[END_OF_BAR:.?Lfunc_end.*]]:{{$}}
24*9880d681SAndroid Build Coastguard Worker; X86-NOT:  ret
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Worker; X86-LABEL: .section        .debug$S,"dr"
27*9880d681SAndroid Build Coastguard Worker; X86:       .secrel32 "?bar@@YAXHZZ"
28*9880d681SAndroid Build Coastguard Worker; X86-NEXT:  .secidx   "?bar@@YAXHZZ"
29*9880d681SAndroid Build Coastguard Worker; X86:       .cv_linetable 1, "?bar@@YAXHZZ", [[END_OF_BAR]]
30*9880d681SAndroid Build Coastguard Worker; X86:       .cv_filechecksums
31*9880d681SAndroid Build Coastguard Worker; X86:       .cv_stringtable
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Worker; ModuleID = 'test.cpp'
34*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
35*9880d681SAndroid Build Coastguard Workertarget triple = "i686-pc-win32"
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind
38*9880d681SAndroid Build Coastguard Workerdefine void @"\01?spam@@YAXXZ"() #0 !dbg !4 {
39*9880d681SAndroid Build Coastguard Workerentry:
40*9880d681SAndroid Build Coastguard Worker  tail call void @"\01?bar@@YAXHZZ"(), !dbg !11
41*9880d681SAndroid Build Coastguard Worker  ret void, !dbg !12
42*9880d681SAndroid Build Coastguard Worker}
43*9880d681SAndroid Build Coastguard Worker
44*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind
45*9880d681SAndroid Build Coastguard Workerdefine internal void @"\01?bar@@YAXHZZ"() #0 !dbg !7 {
46*9880d681SAndroid Build Coastguard Workerentry:
47*9880d681SAndroid Build Coastguard Worker  tail call void @"\01?foo@@YAXXZ"() #2, !dbg !13
48*9880d681SAndroid Build Coastguard Worker  ret void, !dbg !14
49*9880d681SAndroid Build Coastguard Worker}
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard Workerdeclare void @"\01?foo@@YAXXZ"() #1
52*9880d681SAndroid Build Coastguard Worker
53*9880d681SAndroid Build Coastguard Workerattributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
54*9880d681SAndroid Build Coastguard Workerattributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
55*9880d681SAndroid Build Coastguard Workerattributes #2 = { nounwind }
56*9880d681SAndroid Build Coastguard Worker
57*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0}
58*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!8, !9}
59*9880d681SAndroid Build Coastguard Worker!llvm.ident = !{!10}
60*9880d681SAndroid Build Coastguard Worker
61*9880d681SAndroid Build Coastguard Worker!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: LineTablesOnly, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
62*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "test.cpp", directory: "D:\5C")
63*9880d681SAndroid Build Coastguard Worker!2 = !{}
64*9880d681SAndroid Build Coastguard Worker!4 = distinct !DISubprogram(name: "spam", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 7, file: !1, scope: !5, type: !6, variables: !2)
65*9880d681SAndroid Build Coastguard Worker!5 = !DIFile(filename: "test.cpp", directory: "D:C")
66*9880d681SAndroid Build Coastguard Worker!6 = !DISubroutineType(types: !2)
67*9880d681SAndroid Build Coastguard Worker!7 = distinct !DISubprogram(name: "bar", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2)
68*9880d681SAndroid Build Coastguard Worker!8 = !{i32 2, !"CodeView", i32 1}
69*9880d681SAndroid Build Coastguard Worker!9 = !{i32 1, !"Debug Info Version", i32 3}
70*9880d681SAndroid Build Coastguard Worker!10 = !{!"clang version 3.5.0 "}
71*9880d681SAndroid Build Coastguard Worker!11 = !DILocation(line: 8, scope: !4)
72*9880d681SAndroid Build Coastguard Worker!12 = !DILocation(line: 9, scope: !4)
73*9880d681SAndroid Build Coastguard Worker!13 = !DILocation(line: 4, scope: !7)
74*9880d681SAndroid Build Coastguard Worker!14 = !DILocation(line: 5, scope: !7)
75