1 ; RUN: llc -mtriple=riscv32 -mattr=+save-restore < %s
3 ; Ensure that the addition of framesetup instructions which call save/restore
4 ; libcalls do not cause a crash when DIFlagAllCallsDescribed is set.
6 define i32 @main() noreturn nounwind !dbg !7 {
8 tail call void @exit(i32 0)
12 declare void @exit(i32) noreturn
15 !llvm.module.flags = !{!3, !4, !5}
18 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
19 !1 = !DIFile(filename: "saverestore.c", directory: ".")
21 !3 = !{i32 7, !"Dwarf Version", i32 5}
22 !4 = !{i32 2, !"Debug Info Version", i32 3}
23 !5 = !{i32 1, !"wchar_size", i32 4}
25 !7 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
26 !8 = !DISubroutineType(types: !9)
28 !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)