1 ; RUN: llvm-as %s -disable-output 2>&1 | FileCheck %s
3 ; CHECK: function declaration may only have a unique !dbg attachment
4 declare !dbg !4 void @f1()
6 ; CHECK-NOT: function declaration may only have a unique !dbg attachment
7 declare !dbg !6 void @f5()
9 ; CHECK: function must have a single !dbg attachment
10 define void @f2() !dbg !4 !dbg !4 {
14 ; CHECK: DISubprogram attached to more than one function
15 define void @f3() !dbg !4 {
19 ; CHECK: DISubprogram attached to more than one function
20 define void @f4() !dbg !4 {
25 ; CHECK: function !dbg attachment must be a subprogram
26 ; CHECK-NEXT: ptr @bar
27 ; CHECK-NEXT: !{{[0-9]+}} = !{}
28 define void @bar() !dbg !3 {
32 ; CHECK: warning: ignoring invalid debug info
33 !llvm.module.flags = !{!0}
34 !0 = !{i32 2, !"Debug Info Version", i32 3}
37 !1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, retainedTypes: !5)
38 !2 = !DIFile(filename: "t.c", directory: "/path/to/dir")
40 !4 = distinct !DISubprogram(name: "foo", scope: !1, file: !2, unit: !1)
42 !6 = !DISubprogram(name: "f5", scope: !1, file: !2, unit: !1, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)