157 lines · plain
1; REQUIRES: x86-registered-target2; RUN: opt < %s -passes=pseudo-probe -S -o - | FileCheck %s3 4$__clang_call_terminate = comdat any5 6@x = dso_local global i32 0, align 4, !dbg !07 8; Function Attrs: mustprogress noinline nounwind uwtable9define dso_local void @_Z3barv() #0 personality ptr @__gxx_personality_v0 !dbg !14 {10entry:11; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 112 %0 = load volatile i32, ptr @x, align 4, !dbg !17, !tbaa !1913 %tobool = icmp ne i32 %0, 0, !dbg !1714 br i1 %tobool, label %if.then, label %if.else, !dbg !2315 16if.then: ; preds = %entry17; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 218; callsite probe 319 invoke void @_Z3foov()20 to label %invoke.cont unwind label %terminate.lpad, !dbg !2421 22invoke.cont: ; preds = %if.then23; callsite probe 424; CHECK-NOT: call void @llvm.pseudoprobe(i64 -1069303473483922844,25 invoke void @_Z3bazv()26 to label %invoke.cont1 unwind label %terminate.lpad, !dbg !2627 28invoke.cont1: ; preds = %invoke.cont29; CHECK-NOT: call void @llvm.pseudoprobe(i64 -1069303473483922844,30 br label %if.end, !dbg !2731 32if.else: ; preds = %entry33; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 534; callsite probe 635 invoke void @_Z3foov()36 to label %invoke.cont2 unwind label %terminate.lpad, !dbg !2837 38invoke.cont2: ; preds = %if.else39; CHECK-NOT: call void @llvm.pseudoprobe(i64 -1069303473483922844,40 br label %if.end41 42if.end: ; preds = %invoke.cont2, %invoke.cont143; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 744; callsite probe 845 invoke void @_Z3foov()46 to label %invoke.cont3 unwind label %terminate.lpad, !dbg !2947 48invoke.cont3: ; preds = %if.end49; CHECK-NOT: call void @llvm.pseudoprobe(i64 -1069303473483922844,50 %1 = load volatile i32, ptr @x, align 4, !dbg !30, !tbaa !1951 %tobool4 = icmp ne i32 %1, 0, !dbg !3052 br i1 %tobool4, label %if.then5, label %if.end6, !dbg !3253 54if.then5: ; preds = %invoke.cont355; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 956 %2 = load volatile i32, ptr @x, align 4, !dbg !33, !tbaa !1957 %inc = add nsw i32 %2, 1, !dbg !3358 store volatile i32 %inc, ptr @x, align 4, !dbg !33, !tbaa !1959 br label %if.end6, !dbg !3560 61if.end6: ; preds = %if.then5, %invoke.cont362; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 1063 ret void, !dbg !3664 65terminate.lpad: ; preds = %if.end, %if.else, %invoke.cont, %if.then66; CHECK-NOT: call void @llvm.pseudoprobe(i64 -1069303473483922844,67 %3 = landingpad { ptr, i32 }68 catch ptr null, !dbg !2469 %4 = extractvalue { ptr, i32 } %3, 0, !dbg !2470 call void @__clang_call_terminate(ptr %4) #3, !dbg !2471 unreachable, !dbg !2472}73 74; Function Attrs: mustprogress noinline nounwind uwtable75define dso_local void @_Z3foov() #0 !dbg !37 {76entry:77 ret void, !dbg !3878}79 80declare i32 @__gxx_personality_v0(...)81 82; Function Attrs: noinline noreturn nounwind uwtable83define linkonce_odr hidden void @__clang_call_terminate(ptr noundef %0) #1 comdat {84 %2 = call ptr @__cxa_begin_catch(ptr %0) #485 call void @_ZSt9terminatev() #386 unreachable87}88 89declare ptr @__cxa_begin_catch(ptr)90 91declare void @_ZSt9terminatev()92 93; Function Attrs: mustprogress noinline nounwind uwtable94define dso_local void @_Z3bazv() #0 !dbg !39 {95entry:96 ret void, !dbg !4097}98 99; CHECK: ![[#]] = !{i64 -3270123626113159616, i64 4294967295, !"_Z3bazv"}100 101attributes #0 = { mustprogress noinline nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }102attributes #1 = { noinline noreturn nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }103attributes #2 = { mustprogress noinline norecurse nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }104attributes #3 = { noreturn nounwind }105attributes #4 = { nounwind }106 107!llvm.dbg.cu = !{!2}108!llvm.module.flags = !{!7, !8, !9, !10, !11, !12}109!llvm.ident = !{!13}110 111!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())112!1 = distinct !DIGlobalVariable(name: "x", scope: !2, file: !3, line: 1, type: !5, isLocal: false, isDefinition: true)113!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 19.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: None)114!3 = !DIFile(filename: "test.cpp", directory: "/home", checksumkind: CSK_MD5, checksum: "a4c7b0392f3fd9c8ebb85065159dbb02")115!4 = !{!0}116!5 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !6)117!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)118!7 = !{i32 7, !"Dwarf Version", i32 5}119!8 = !{i32 2, !"Debug Info Version", i32 3}120!9 = !{i32 1, !"wchar_size", i32 4}121!10 = !{i32 8, !"PIC Level", i32 2}122!11 = !{i32 7, !"PIE Level", i32 2}123!12 = !{i32 7, !"uwtable", i32 2}124!13 = !{!"clang version 19.0.0"}125!14 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !3, file: !3, line: 4, type: !15, scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2)126!15 = !DISubroutineType(types: !16)127!16 = !{null}128!17 = !DILocation(line: 5, column: 6, scope: !18)129!18 = distinct !DILexicalBlock(scope: !14, file: !3, line: 5, column: 6)130!19 = !{!20, !20, i64 0}131!20 = !{!"int", !21, i64 0}132!21 = !{!"omnipotent char", !22, i64 0}133!22 = !{!"Simple C++ TBAA"}134!23 = !DILocation(line: 5, column: 6, scope: !14)135!24 = !DILocation(line: 6, column: 5, scope: !25)136!25 = distinct !DILexicalBlock(scope: !18, file: !3, line: 5, column: 9)137!26 = !DILocation(line: 7, column: 5, scope: !25)138!27 = !DILocation(line: 8, column: 3, scope: !25)139!28 = !DILocation(line: 9, column: 5, scope: !18)140!29 = !DILocation(line: 11, column: 3, scope: !14)141!30 = !DILocation(line: 12, column: 6, scope: !31)142!31 = distinct !DILexicalBlock(scope: !14, file: !3, line: 12, column: 6)143!32 = !DILocation(line: 12, column: 6, scope: !14)144!33 = !DILocation(line: 13, column: 5, scope: !34)145!34 = distinct !DILexicalBlock(scope: !31, file: !3, line: 12, column: 9)146!35 = !DILocation(line: 14, column: 5, scope: !34)147!36 = !DILocation(line: 17, column: 1, scope: !14)148!37 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !3, file: !3, line: 19, type: !15, scopeLine: 19, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2)149!38 = !DILocation(line: 19, column: 13, scope: !37)150!39 = distinct !DISubprogram(name: "baz", linkageName: "_Z3bazv", scope: !3, file: !3, line: 18, type: !15, scopeLine: 18, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2)151!40 = !DILocation(line: 18, column: 13, scope: !39)152!41 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 22, type: !42, scopeLine: 22, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2)153!42 = !DISubroutineType(types: !43)154!43 = !{!6}155!44 = !DILocation(line: 23, column: 3, scope: !41)156!45 = !DILocation(line: 24, column: 1, scope: !41)157