brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.8 KiB · 8c97afb Raw
197 lines · plain
1; RUN: llc < %s | FileCheck %s2 3; Verify that we get *two* .debug$S sections, the main one describing bar and4; main, and one for f and fin$f, which is comdat with f.5 6; Start in the main symbol section describing bar and main.7 8; CHECK: .section .debug$S,"dr"{{$}}9; CHECK: .long 4 # Debug section magic10; CHECK: # Symbol subsection for bar11; CHECK-NOT: Debug section magic12; CHECK: # Symbol subsection for main13 14; Emit symbol info for f and its associated code in a separate associated15; section.16 17; CHECK: .section .debug$S,"dr",associative,f{{$}}18; CHECK: .long 4 # Debug section magic19; CHECK: # Symbol subsection for f20; CHECK-NOT: Debug section magic21; CHECK: # Symbol subsection for ?fin$0@0@f@@22 23; Switch back to the main section for the shared file checksum table and string24; table.25 26; CHECK: .section .debug$S,"dr"{{$}}27; CHECK-NOT: Debug section magic28; CHECK: .cv_filechecksums29; CHECK: .cv_stringtable30; CHECK-NOT: .section .debug$S,31 32; Generated with this C++ source:33; void foo();34; void bar();35; extern volatile int x;36; inline void __declspec(noinline) f(bool c) {37;   x++;38;   if (c) {39;     __try {40;       foo();41;     } __finally {42;       x++;43;     }44;   } else45;     bar();46;   x++;47; }48; void bar() {49;   x++;50; }51; int main() {52;   f(true);53; }54 55; ModuleID = 't.cpp'56source_filename = "t.cpp"57target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"58target triple = "x86_64-pc-windows-msvc19.0.23918"59 60$f = comdat any61 62@x = external global i32, align 463 64; Function Attrs: norecurse nounwind uwtable65define void @bar() #0 !dbg !7 {66entry:67  %0 = load volatile i32, ptr @x, align 4, !dbg !10, !tbaa !1168  %inc = add nsw i32 %0, 1, !dbg !1069  store volatile i32 %inc, ptr @x, align 4, !dbg !10, !tbaa !1170  ret void, !dbg !1571}72 73; Function Attrs: nounwind uwtable74define i32 @main() #1 !dbg !16 {75entry:76  tail call void @f(i32 1), !dbg !2077  ret i32 0, !dbg !2178}79 80; Function Attrs: inlinehint noinline nounwind uwtable81define linkonce_odr void @f(i32 %c) #2 comdat personality ptr @__C_specific_handler !dbg !22 {82entry:83  tail call void @llvm.dbg.value(metadata i32 %c, metadata !26, metadata !27), !dbg !2884  %0 = load volatile i32, ptr @x, align 4, !dbg !29, !tbaa !1185  %inc = add nsw i32 %0, 1, !dbg !2986  store volatile i32 %inc, ptr @x, align 4, !dbg !29, !tbaa !1187  %tobool = icmp eq i32 %c, 0, !dbg !3088  br i1 %tobool, label %if.else, label %if.then, !dbg !3289 90if.then:                                          ; preds = %entry91  invoke void @foo() #692          to label %invoke.cont unwind label %ehcleanup, !dbg !3393 94invoke.cont:                                      ; preds = %if.then95  tail call fastcc void @"\01?fin$0@0@f@@"() #7, !dbg !3696  br label %if.end, !dbg !3797 98ehcleanup:                                        ; preds = %if.then99  %1 = cleanuppad within none [], !dbg !36100  tail call fastcc void @"\01?fin$0@0@f@@"() #7 [ "funclet"(token %1) ], !dbg !36101  cleanupret from %1 unwind to caller, !dbg !36102 103if.else:                                          ; preds = %entry104  tail call void @bar(), !dbg !38105  br label %if.end106 107if.end:                                           ; preds = %if.else, %invoke.cont108  %2 = load volatile i32, ptr @x, align 4, !dbg !39, !tbaa !11109  %inc1 = add nsw i32 %2, 1, !dbg !39110  store volatile i32 %inc1, ptr @x, align 4, !dbg !39, !tbaa !11111  ret void, !dbg !40112}113 114; Function Attrs: nounwind115define internal fastcc void @"\01?fin$0@0@f@@"() unnamed_addr #3 comdat($f) !dbg !41 {116entry:117  tail call void @llvm.dbg.value(metadata ptr null, metadata !44, metadata !27), !dbg !48118  tail call void @llvm.dbg.value(metadata i8 0, metadata !46, metadata !27), !dbg !48119  %0 = load volatile i32, ptr @x, align 4, !dbg !49, !tbaa !11120  %inc = add nsw i32 %0, 1, !dbg !49121  store volatile i32 %inc, ptr @x, align 4, !dbg !49, !tbaa !11122  ret void, !dbg !51123}124 125declare void @foo(...) #4126 127declare i32 @__C_specific_handler(...)128 129; Function Attrs: nounwind readnone130declare void @llvm.dbg.value(metadata, metadata, metadata) #5131 132attributes #0 = { norecurse nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }133attributes #1 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }134attributes #2 = { inlinehint noinline nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }135attributes #3 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }136attributes #4 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }137attributes #5 = { nounwind readnone }138attributes #6 = { noinline }139attributes #7 = { nounwind }140 141!llvm.dbg.cu = !{!0}142!llvm.module.flags = !{!3, !4, !5}143!llvm.ident = !{!6}144 145!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)146!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")147!2 = !{}148!3 = !{i32 2, !"CodeView", i32 1}149!4 = !{i32 2, !"Debug Info Version", i32 3}150!5 = !{i32 1, !"PIC Level", i32 2}151!6 = !{!"clang version 3.9.0 "}152!7 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 19, type: !8, isLocal: false, isDefinition: true, scopeLine: 19, isOptimized: true, unit: !0, retainedNodes: !2)153!8 = !DISubroutineType(types: !9)154!9 = !{null}155!10 = !DILocation(line: 20, column: 4, scope: !7)156!11 = !{!12, !12, i64 0}157!12 = !{!"int", !13, i64 0}158!13 = !{!"omnipotent char", !14, i64 0}159!14 = !{!"Simple C/C++ TBAA"}160!15 = !DILocation(line: 21, column: 1, scope: !7)161!16 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 22, type: !17, isLocal: false, isDefinition: true, scopeLine: 22, isOptimized: true, unit: !0, retainedNodes: !2)162!17 = !DISubroutineType(types: !18)163!18 = !{!19}164!19 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)165!20 = !DILocation(line: 23, column: 3, scope: !16)166!21 = !DILocation(line: 24, column: 1, scope: !16)167!22 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 5, type: !23, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !25)168!23 = !DISubroutineType(types: !24)169!24 = !{null, !19}170!25 = !{!26}171!26 = !DILocalVariable(name: "c", arg: 1, scope: !22, file: !1, line: 5, type: !19)172!27 = !DIExpression()173!28 = !DILocation(line: 5, column: 40, scope: !22)174!29 = !DILocation(line: 6, column: 4, scope: !22)175!30 = !DILocation(line: 7, column: 7, scope: !31)176!31 = distinct !DILexicalBlock(scope: !22, file: !1, line: 7, column: 7)177!32 = !DILocation(line: 7, column: 7, scope: !22)178!33 = !DILocation(line: 9, column: 7, scope: !34)179!34 = distinct !DILexicalBlock(scope: !35, file: !1, line: 8, column: 11)180!35 = distinct !DILexicalBlock(scope: !31, file: !1, line: 7, column: 10)181!36 = !DILocation(line: 10, column: 5, scope: !34)182!37 = !DILocation(line: 13, column: 3, scope: !35)183!38 = !DILocation(line: 14, column: 5, scope: !31)184!39 = !DILocation(line: 15, column: 4, scope: !22)185!40 = !DILocation(line: 16, column: 1, scope: !22)186!41 = distinct !DISubprogram(linkageName: "\01?fin$0@0@f@@", scope: !1, file: !1, line: 10, type: !42, isLocal: true, isDefinition: true, scopeLine: 10, flags: DIFlagArtificial, isOptimized: true, unit: !0, retainedNodes: !43)187!42 = !DISubroutineType(types: !2)188!43 = !{!44, !46}189!44 = !DILocalVariable(name: "frame_pointer", arg: 2, scope: !41, type: !45, flags: DIFlagArtificial)190!45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64, align: 64)191!46 = !DILocalVariable(name: "abnormal_termination", arg: 1, scope: !41, type: !47, flags: DIFlagArtificial | DIFlagObjectPointer)192!47 = !DIBasicType(name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)193!48 = !DILocation(line: 0, scope: !41)194!49 = !DILocation(line: 11, column: 8, scope: !50)195!50 = distinct !DILexicalBlock(scope: !41, file: !1, line: 10, column: 17)196!51 = !DILocation(line: 12, column: 5, scope: !41)197