# Restrict the number of unwind codes to 8 # RUN: llc -mtriple=x86_64-pc-windows-msvc -o - %s \ # RUN: -x86-wineh-unwindv2-unwind-codes-threshold=8 \ # RUN: -run-pass=x86-wineh-unwindv2 | FileCheck %s \ # RUN: -check-prefixes=ALLOWLESS,CHECK # RUN: llc -mtriple=x86_64-pc-windows-msvc -o - %s \ # RUN: -x86-wineh-unwindv2-unwind-codes-threshold=8 \ # RUN: -passes=x86-wineh-unwindv2 | FileCheck %s \ # RUN: -check-prefixes=ALLOWLESS,CHECK # Allow the default number of unwind codes (255) # RUN: llc -mtriple=x86_64-pc-windows-msvc -o - %s \ # RUN: -run-pass=x86-wineh-unwindv2 | FileCheck %s \ # RUN: -check-prefixes=ALLOWMORE,CHECK # RUN: llc -mtriple=x86_64-pc-windows-msvc -o - %s \ # RUN: -passes=x86-wineh-unwindv2 | FileCheck %s \ # RUN: -check-prefixes=ALLOWMORE,CHECK # CHECK-LABEL: too_many_epilogs # CHECK: SEH_UnwindVersion 2 # CHECK: SEH_UnwindV2Start # If we restricted the number of unwind codes, then we expect to use chained # infos. # ALLOWLESS: SEH_SplitChainedAtEndOfBlock # ALLOWMORE-NOT: SEH_SplitChainedAtEndOfBlock --- | define dso_local void @too_many_epilogs() local_unnamed_addr !dbg !9 { entry: ret void, !dbg !10 } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!2, !3, !4, !5} !0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) !1 = !DIFile(filename: "/app/example.c", directory: "/app") !2 = !{i32 1, !"winx64-eh-unwindv2", i32 2} !3 = !{i32 7, !"Dwarf Version", i32 4} !4 = !{i32 2, !"CodeView", i32 1} !5 = !{i32 2, !"Debug Info Version", i32 3} !6 = !DIFile(filename: "example.c", directory: "/app") !7 = !DISubroutineType(types: !8) !8 = !{null} !9 = distinct !DISubprogram(name: "too_many_epilogs", scope: !6, file: !6, line: 1, type: !7, scopeLine: 2, spFlags: DISPFlagDefinition, unit: !0) !10 = !DILocation(line: 2, column: 1, scope: !9) !11 = !DILocation(line: 3, column: 1, scope: !9) ... --- name: too_many_epilogs body: | bb.0.entry: frame-setup SEH_EndPrologue SEH_BeginEpilogue SEH_EndEpilogue RET64 debug-location !10 bb.1: SEH_BeginEpilogue SEH_EndEpilogue RET64 debug-location !11 bb.2: SEH_BeginEpilogue SEH_EndEpilogue RET64 debug-location !11 bb.3: SEH_BeginEpilogue SEH_EndEpilogue RET64 debug-location !11 bb.4: SEH_BeginEpilogue SEH_EndEpilogue RET64 debug-location !11 bb.5: SEH_BeginEpilogue SEH_EndEpilogue RET64 debug-location !11 bb.6: SEH_BeginEpilogue SEH_EndEpilogue RET64 debug-location !11 bb.7: SEH_BeginEpilogue SEH_EndEpilogue RET64 debug-location !11 bb.8: SEH_BeginEpilogue SEH_EndEpilogue RET64 debug-location !11 ...