Timur Iskhodzhanov | 6a35c15 | 2014-03-26 09:51:45 +0000 | [diff] [blame] | 1 | ; 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 Iskhodzhanov | 7eaa825 | 2014-03-27 08:46:44 +0000 | [diff] [blame] | 14 | ; |
| 15 | ; The bar function happens to have no lexical scopes, yet it has one instruction |
Timur Iskhodzhanov | b714601 | 2014-03-27 08:52:14 +0000 | [diff] [blame] | 16 | ; with debug information available. This used to be PR19239. |
Timur Iskhodzhanov | 6a35c15 | 2014-03-26 09:51:45 +0000 | [diff] [blame] | 17 | |
Reid Kleckner | 2214ed8 | 2016-01-29 00:49:42 +0000 | [diff] [blame] | 18 | ; X86: .cv_file 1 "D:\\test.cpp" |
| 19 | |
Timur Iskhodzhanov | 6a35c15 | 2014-03-26 09:51:45 +0000 | [diff] [blame] | 20 | ; X86-LABEL: {{^}}"?bar@@YAXHZZ": |
Reid Kleckner | 2214ed8 | 2016-01-29 00:49:42 +0000 | [diff] [blame] | 21 | ; X86: .cv_loc 1 1 4 0 |
David Majnemer | b925715 | 2014-11-04 08:03:31 +0000 | [diff] [blame] | 22 | ; X86: jmp "?foo@@YAXXZ" |
Reid Kleckner | f9c275f | 2016-02-10 20:55:49 +0000 | [diff] [blame] | 23 | ; X86: [[END_OF_BAR:.?Lfunc_end.*]]:{{$}} |
Timur Iskhodzhanov | 6a35c15 | 2014-03-26 09:51:45 +0000 | [diff] [blame] | 24 | ; X86-NOT: ret |
| 25 | |
David Majnemer | 5614ea9 | 2015-02-07 08:26:40 +0000 | [diff] [blame] | 26 | ; X86-LABEL: .section .debug$S,"dr" |
Timur Iskhodzhanov | 6a35c15 | 2014-03-26 09:51:45 +0000 | [diff] [blame] | 27 | ; X86: .secrel32 "?bar@@YAXHZZ" |
| 28 | ; X86-NEXT: .secidx "?bar@@YAXHZZ" |
Reid Kleckner | 2214ed8 | 2016-01-29 00:49:42 +0000 | [diff] [blame] | 29 | ; X86: .cv_linetable 1, "?bar@@YAXHZZ", [[END_OF_BAR]] |
| 30 | ; X86: .cv_filechecksums |
| 31 | ; X86: .cv_stringtable |
Timur Iskhodzhanov | 6a35c15 | 2014-03-26 09:51:45 +0000 | [diff] [blame] | 32 | |
| 33 | ; ModuleID = 'test.cpp' |
| 34 | target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32" |
| 35 | target triple = "i686-pc-win32" |
| 36 | |
| 37 | ; Function Attrs: nounwind |
Reid Kleckner | f9c275f | 2016-02-10 20:55:49 +0000 | [diff] [blame] | 38 | define void @"\01?spam@@YAXXZ"() #0 !dbg !4 { |
Timur Iskhodzhanov | 6a35c15 | 2014-03-26 09:51:45 +0000 | [diff] [blame] | 39 | entry: |
| 40 | tail call void @"\01?bar@@YAXHZZ"(), !dbg !11 |
| 41 | ret void, !dbg !12 |
| 42 | } |
| 43 | |
| 44 | ; Function Attrs: nounwind |
Reid Kleckner | f9c275f | 2016-02-10 20:55:49 +0000 | [diff] [blame] | 45 | define internal void @"\01?bar@@YAXHZZ"() #0 !dbg !7 { |
Timur Iskhodzhanov | 6a35c15 | 2014-03-26 09:51:45 +0000 | [diff] [blame] | 46 | entry: |
| 47 | tail call void @"\01?foo@@YAXXZ"() #2, !dbg !13 |
| 48 | ret void, !dbg !14 |
| 49 | } |
| 50 | |
| 51 | declare void @"\01?foo@@YAXXZ"() #1 |
| 52 | |
| 53 | attributes #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 | attributes #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 | attributes #2 = { nounwind } |
| 56 | |
| 57 | !llvm.dbg.cu = !{!0} |
| 58 | !llvm.module.flags = !{!8, !9} |
| 59 | !llvm.ident = !{!10} |
| 60 | |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 61 | !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) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 62 | !1 = !DIFile(filename: "test.cpp", directory: "D:\5C") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 63 | !2 = !{} |
Shiva Chen | 2c86455 | 2018-05-09 02:40:45 +0000 | [diff] [blame] | 64 | !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, retainedNodes: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 65 | !5 = !DIFile(filename: "test.cpp", directory: "D:C") |
| 66 | !6 = !DISubroutineType(types: !2) |
Shiva Chen | 2c86455 | 2018-05-09 02:40:45 +0000 | [diff] [blame] | 67 | !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, retainedNodes: !2) |
Reid Kleckner | 12d2c12 | 2015-08-05 22:26:20 +0000 | [diff] [blame] | 68 | !8 = !{i32 2, !"CodeView", i32 1} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 69 | !9 = !{i32 1, !"Debug Info Version", i32 3} |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 70 | !10 = !{!"clang version 3.5.0 "} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 71 | !11 = !DILocation(line: 8, scope: !4) |
| 72 | !12 = !DILocation(line: 9, scope: !4) |
| 73 | !13 = !DILocation(line: 4, scope: !7) |
| 74 | !14 = !DILocation(line: 5, scope: !7) |