95 lines · plain
1# Require V2 and restrict the number of unwind codes to 82# RUN: not llc -mtriple=x86_64-pc-windows-msvc -o - %s \3# RUN: -run-pass=x86-wineh-unwindv2 -x86-wineh-unwindv2-max-unwind-codes=8 \4# RUN: 2>&1 | FileCheck %s -check-prefix=REQUIREV25 6# Force best-effort and restrict the number of unwind codes to 87# RUN: llc -mtriple=x86_64-pc-windows-msvc -o - %s \8# RUN: -run-pass=x86-wineh-unwindv2 -x86-wineh-unwindv2-max-unwind-codes=8 \9# RUN: -x86-wineh-unwindv2-force-mode=1 | \10# RUN: FileCheck %s -check-prefix=BESTEFFORT11 12# Require V2, but allow the default number of unwind codes (255)13# RUN: llc -mtriple=x86_64-pc-windows-msvc -o - %s \14# RUN: -run-pass=x86-wineh-unwindv2 | FileCheck %s -check-prefix=ALLOWMORE15 16# Usually 255 unwind codes are permitted, but we passed an arg to llc to limit17# it to 8.18# REQUIREV2: error: example.c:2:1: Windows x64 Unwind v2 is required, but the function 'too_many_epilogs' has too many unwind codes.19# REQUIREV2-SAME: Try splitting the function or reducing the number of places where it exits early with a tail call.20 21# If we force "best effort" mode, then we won't see any errors, but we won't use22# v2.23# BESTEFFORT-NOT: SEH_UnwindVersion24# BESTEFFORT-NOT: SEH_UnwindV2Start25 26# If we allow more epilogs then too_many_epilogs will compile with v2.27# ALLOWMORE-LABEL: too_many_epilogs28# ALLOWMORE: SEH_UnwindVersion 229# ALLOWMORE: SEH_UnwindV2Start30 31--- |32 define dso_local void @too_many_epilogs() local_unnamed_addr !dbg !9 {33 entry:34 ret void, !dbg !1035 }36 37 !llvm.dbg.cu = !{!0}38 !llvm.module.flags = !{!2, !3, !4, !5}39 40 !0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)41 !1 = !DIFile(filename: "/app/example.c", directory: "/app")42 !2 = !{i32 1, !"winx64-eh-unwindv2", i32 2}43 !3 = !{i32 7, !"Dwarf Version", i32 4}44 !4 = !{i32 2, !"CodeView", i32 1}45 !5 = !{i32 2, !"Debug Info Version", i32 3}46 !6 = !DIFile(filename: "example.c", directory: "/app")47 !7 = !DISubroutineType(types: !8)48 !8 = !{null}49 !9 = distinct !DISubprogram(name: "too_many_epilogs", scope: !6, file: !6, line: 1, type: !7, scopeLine: 2, spFlags: DISPFlagDefinition, unit: !0)50 !10 = !DILocation(line: 2, column: 1, scope: !9)51 !11 = !DILocation(line: 3, column: 1, scope: !9)52...53---54name: too_many_epilogs55body: |56 bb.0.entry:57 frame-setup SEH_EndPrologue58 SEH_BeginEpilogue59 SEH_EndEpilogue60 RET64 debug-location !1061 bb.1:62 SEH_BeginEpilogue63 SEH_EndEpilogue64 RET64 debug-location !1165 bb.2:66 SEH_BeginEpilogue67 SEH_EndEpilogue68 RET64 debug-location !1169 bb.3:70 SEH_BeginEpilogue71 SEH_EndEpilogue72 RET64 debug-location !1173 bb.4:74 SEH_BeginEpilogue75 SEH_EndEpilogue76 RET64 debug-location !1177 bb.5:78 SEH_BeginEpilogue79 SEH_EndEpilogue80 RET64 debug-location !1181 bb.6:82 SEH_BeginEpilogue83 SEH_EndEpilogue84 RET64 debug-location !1185 bb.7:86 SEH_BeginEpilogue87 SEH_EndEpilogue88 RET64 debug-location !1189 bb.8:90 SEH_BeginEpilogue91 SEH_EndEpilogue92 RET64 debug-location !1193 94...95