xref: /llvm-project/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-subroutinetypes.ll (revision 211cf8a384ebb29787367c8fd5858e2a5ed3c10f)
1; RUN: opt -S -passes=strip-nonlinetable-debuginfo %s -o - | FileCheck %s
2; Test that subroutine types are downgraded to (void)().
3define internal i32 @"__hidden#2878_"() #0 !dbg !12 {
4  ret i32 0, !dbg !634
5}
6!llvm.dbg.cu = !{!18}
7!llvm.module.flags = !{!482}
8!5 = !{}
9!2 = !{!12}
10; CHECK-NOT: DICompositeType
11; CHECK: distinct !DISubprogram(name: "f", {{.*}}, type: ![[FNTY:[0-9]+]]
12; CHECK: ![[FNTY]] = !DISubroutineType(types: ![[VOID:[0-9]+]])
13; CHECK: ![[VOID]] = !{}
14; CHECK-NOT: DICompositeType
15!12 = distinct !DISubprogram(name: "f", scope: !16, file: !16, line: 133, type: !13, isLocal: true, isDefinition: true, scopeLine: 133, flags: DIFlagPrototyped, isOptimized: true, unit: !18, retainedNodes: !5)
16!13 = !DISubroutineType(types: !14)
17!14 = !{!17}
18!16 = !DIFile(filename: "f.m", directory: "/")
19!17 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "e", scope: !18, file: !16, line: 13, size: 32, align: 32, flags: DIFlagFwdDecl)
20!18 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !16, producer: "clang", isOptimized: true, runtimeVersion: 2, emissionKind: 1, enums: !14, retainedTypes: !14, globals: !5, imports: !5)
21!482 = !{i32 2, !"Debug Info Version", i32 3}
22!634 = !DILocation(line: 143, column: 5, scope: !12)
23