Reid Kleckner | de3d8b5 | 2016-06-08 20:34:29 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -filetype=obj -o %t |
Adrian Prantl | 16aa4cf | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 2 | ; RUN: llvm-dwarfdump -v %t | FileCheck %s |
Reid Kleckner | de3d8b5 | 2016-06-08 20:34:29 +0000 | [diff] [blame] | 3 | |
| 4 | ; C++ source to regenerate: |
| 5 | ; $ cat t.cpp |
| 6 | ; struct A { |
| 7 | ; void thiscallcc(); |
| 8 | ; }; |
| 9 | ; void A::thiscallcc() {} |
| 10 | ; void cdeclcc() {} |
| 11 | ; void __fastcall fastcallcc() {} |
| 12 | ; void __stdcall stdcallcc() {} |
| 13 | ; void __vectorcall vectorcallcc() {} |
| 14 | ; $ clang -g t.cpp -emit-llvm -S -o t.ll -O1 |
| 15 | |
| 16 | ; CHECK: .debug_abbrev contents: |
| 17 | |
| 18 | ; CHECK: [[subroutine_abbrev:\[[0-9]+\]]] DW_TAG_subroutine_type DW_CHILDREN_yes |
| 19 | ; CHECK-NEXT: DW_AT_type DW_FORM_ref4 |
| 20 | ; CHECK-NEXT: DW_AT_calling_convention DW_FORM_data1 |
| 21 | |
| 22 | ; CHECK: .debug_info contents: |
| 23 | |
| 24 | ; CHECK: DW_TAG_subroutine_type [[subroutine_abbrev]] * |
| 25 | ; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] {{.*}} |
| 26 | ; CHECK-NEXT: DW_AT_calling_convention [DW_FORM_data1] (DW_CC_BORLAND_msfastcall) |
| 27 | |
| 28 | ; CHECK: DW_TAG_subprogram [{{.*}}] * |
| 29 | ; CHECK: DW_AT_low_pc |
| 30 | ; CHECK: DW_AT_high_pc |
| 31 | ; CHECK: DW_AT_frame_base |
| 32 | ; CHECK: DW_AT_linkage_name |
| 33 | ; CHECK: DW_AT_name |
| 34 | ; CHECK: DW_AT_decl_file |
| 35 | ; CHECK: DW_AT_decl_line |
| 36 | ; CHECK: DW_AT_calling_convention [DW_FORM_data1] (DW_CC_BORLAND_msfastcall) |
| 37 | ; CHECK: DW_AT_type |
| 38 | ; CHECK: DW_AT_external |
| 39 | |
| 40 | ; ModuleID = 't.cpp' |
| 41 | source_filename = "t.cpp" |
| 42 | target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" |
| 43 | target triple = "i386-pc-windows-msvc19.0.23918" |
| 44 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 45 | @"\01?fptr@@3P6IHHH@ZA" = global i32 (i32, i32)* @"\01?f@@YIHHH@Z", align 4, !dbg !0 |
Reid Kleckner | de3d8b5 | 2016-06-08 20:34:29 +0000 | [diff] [blame] | 46 | |
| 47 | ; Function Attrs: nounwind readnone |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 48 | define x86_fastcallcc i32 @"\01?f@@YIHHH@Z"(i32 inreg %a, i32 inreg %b) #0 !dbg !13 { |
Reid Kleckner | de3d8b5 | 2016-06-08 20:34:29 +0000 | [diff] [blame] | 49 | entry: |
Adrian Prantl | abe0475 | 2017-07-28 20:21:02 +0000 | [diff] [blame] | 50 | tail call void @llvm.dbg.value(metadata i32 %b, metadata !15, metadata !17), !dbg !18 |
| 51 | tail call void @llvm.dbg.value(metadata i32 %a, metadata !16, metadata !17), !dbg !19 |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 52 | %add = add nsw i32 %b, %a, !dbg !20 |
| 53 | ret i32 %add, !dbg !21 |
Reid Kleckner | de3d8b5 | 2016-06-08 20:34:29 +0000 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | ; Function Attrs: nounwind readnone |
Adrian Prantl | abe0475 | 2017-07-28 20:21:02 +0000 | [diff] [blame] | 57 | declare void @llvm.dbg.value(metadata, metadata, metadata) #1 |
Reid Kleckner | de3d8b5 | 2016-06-08 20:34:29 +0000 | [diff] [blame] | 58 | |
| 59 | attributes #0 = { nounwind readnone "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 60 | attributes #1 = { nounwind readnone } |
| 61 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 62 | !llvm.dbg.cu = !{!2} |
| 63 | !llvm.module.flags = !{!10, !11} |
| 64 | !llvm.ident = !{!12} |
Reid Kleckner | de3d8b5 | 2016-06-08 20:34:29 +0000 | [diff] [blame] | 65 | |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 66 | !0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 67 | !1 = !DIGlobalVariable(name: "fptr", linkageName: "\01?fptr@@3P6IHHH@ZA", scope: !2, file: !3, line: 2, type: !6, isLocal: false, isDefinition: true) |
| 68 | !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 272067)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5) |
| 69 | !3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild") |
| 70 | !4 = !{} |
| 71 | !5 = !{!0} |
| 72 | !6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 32, align: 32) |
| 73 | !7 = !DISubroutineType(cc: DW_CC_BORLAND_msfastcall, types: !8) |
| 74 | !8 = !{!9, !9, !9} |
| 75 | !9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 76 | !10 = !{i32 2, !"Dwarf Version", i32 4} |
| 77 | !11 = !{i32 2, !"Debug Info Version", i32 3} |
| 78 | !12 = !{!"clang version 3.9.0 (trunk 272067)"} |
| 79 | !13 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YIHHH@Z", scope: !3, file: !3, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !14) |
| 80 | !14 = !{!15, !16} |
| 81 | !15 = !DILocalVariable(name: "b", arg: 2, scope: !13, file: !3, line: 1, type: !9) |
| 82 | !16 = !DILocalVariable(name: "a", arg: 1, scope: !13, file: !3, line: 1, type: !9) |
| 83 | !17 = !DIExpression() |
| 84 | !18 = !DILocation(line: 1, column: 29, scope: !13) |
| 85 | !19 = !DILocation(line: 1, column: 22, scope: !13) |
| 86 | !20 = !DILocation(line: 1, column: 43, scope: !13) |
| 87 | !21 = !DILocation(line: 1, column: 34, scope: !13) |
| 88 | |