blob: 29857443bbbe45b11b8dd39ceb0dd6ae5fe5e5de [file] [log] [blame]
Timur Iskhodzhanov6a35c152014-03-26 09:51:45 +00001; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s
2
3; This LL file was generated by running clang on the following code:
4; D:\test.cpp:
5; 1 void foo();
6; 2
7; 3 static void bar(int arg, ...) {
8; 4 foo();
9; 5 }
10; 6
11; 7 void spam(void) {
12; 8 bar(42);
13; 9 }
Timur Iskhodzhanov7eaa8252014-03-27 08:46:44 +000014;
15; The bar function happens to have no lexical scopes, yet it has one instruction
Timur Iskhodzhanovb7146012014-03-27 08:52:14 +000016; with debug information available. This used to be PR19239.
Timur Iskhodzhanov6a35c152014-03-26 09:51:45 +000017
18; X86-LABEL: {{^}}"?bar@@YAXHZZ":
Rafael Espindola07c03d32015-03-05 02:05:42 +000019; X86-NEXT: L{{.*}}:
Timur Iskhodzhanov6a35c152014-03-26 09:51:45 +000020; X86-NEXT: # BB
21; X86-NEXT: [[JMP_LINE:^L.*]]:{{$}}
David Majnemerb9257152014-11-04 08:03:31 +000022; X86: jmp "?foo@@YAXXZ"
Timur Iskhodzhanov6a35c152014-03-26 09:51:45 +000023; X86-NEXT: [[END_OF_BAR:^L.*]]:{{$}}
24; X86-NOT: ret
25
David Majnemer5614ea92015-02-07 08:26:40 +000026; X86-LABEL: .section .debug$S,"dr"
Timur Iskhodzhanov6a35c152014-03-26 09:51:45 +000027; X86: .secrel32 "?bar@@YAXHZZ"
28; X86-NEXT: .secidx "?bar@@YAXHZZ"
29; X86: .long 0
30; X86-NEXT: .long 1
31; X86-NEXT: .long {{.*}}
32; X86-NEXT: .long [[JMP_LINE]]-"?bar@@YAXHZZ"
33; X86-NEXT: .long 4
34
35; X86-LABEL: .long 244
36
37; ModuleID = 'test.cpp'
38target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
39target triple = "i686-pc-win32"
40
41; Function Attrs: nounwind
42define void @"\01?spam@@YAXXZ"() #0 {
43entry:
44 tail call void @"\01?bar@@YAXHZZ"(), !dbg !11
45 ret void, !dbg !12
46}
47
48; Function Attrs: nounwind
49define internal void @"\01?bar@@YAXHZZ"() #0 {
50entry:
51 tail call void @"\01?foo@@YAXXZ"() #2, !dbg !13
52 ret void, !dbg !14
53}
54
55declare void @"\01?foo@@YAXXZ"() #1
56
57attributes #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" }
58attributes #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" }
59attributes #2 = { nounwind }
60
61!llvm.dbg.cu = !{!0}
62!llvm.module.flags = !{!8, !9}
63!llvm.ident = !{!10}
64
Duncan P. N. Exon Smith55ca9642015-08-03 17:26:41 +000065!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000066!1 = !DIFile(filename: "test.cpp", directory: "D:\5C")
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000067!2 = !{}
68!3 = !{!4, !7}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000069!4 = !DISubprogram(name: "spam", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 7, file: !1, scope: !5, type: !6, function: void ()* @"\01?spam@@YAXXZ", variables: !2)
70!5 = !DIFile(filename: "test.cpp", directory: "D:C")
71!6 = !DISubroutineType(types: !2)
72!7 = !DISubprogram(name: "bar", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2)
Reid Kleckner12d2c122015-08-05 22:26:20 +000073!8 = !{i32 2, !"CodeView", i32 1}
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000074!9 = !{i32 1, !"Debug Info Version", i32 3}
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000075!10 = !{!"clang version 3.5.0 "}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000076!11 = !DILocation(line: 8, scope: !4)
77!12 = !DILocation(line: 9, scope: !4)
78!13 = !DILocation(line: 4, scope: !7)
79!14 = !DILocation(line: 5, scope: !7)