Index: test/DebugInfo/macro_link.ll =================================================================== --- test/DebugInfo/macro_link.ll +++ test/DebugInfo/macro_link.ll @@ -0,0 +1,40 @@ +; RUN: llvm-link %s %s -S -o -| FileCheck %s + +; This test checks that DIMacro and DIMacroFile comaprison works correctly. + +; CHECK: !llvm.dbg.cu = !{!0, !11} +; CHECK: !llvm.ident = !{!12, !12} +; CHECK: !llvm.module.flags = !{!13} + +; CHECK: !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 276746)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, macros: !3) +; CHECK: !1 = !DIFile(filename: "t.c", directory: "/") +; CHECK: !2 = !{} +; CHECK: !3 = !{!4, !5} +; CHECK: !4 = !DIMacro(type: DW_MACINFO_undef, line: 1, name: "X") +; CHECK: !5 = !DIMacroFile(line: 2, file: !6, nodes: !7) +; CHECK: !6 = !DIFile(filename: "t.h", directory: "/") +; CHECK: !7 = !{!8, !9} +; CHECK: !8 = !DIMacro(type: DW_MACINFO_define, line: 3, name: "X", value: "5") +; CHECK: !9 = !DIMacroFile(line: 4, file: !10) +; CHECK: !10 = !DIFile(filename: "t2.h", directory: "/") +; CHECK: !11 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 276746)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, macros: !3) +; CHECK: !12 = !{!"clang version 4.0.0 (trunk 276746)"} +; CHECK: !13 = !{i32 2, !"Debug Info Version", i32 3} + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!11} +!llvm.ident = !{!12} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 276746)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, macros: !3) +!1 = !DIFile(filename: "t.c", directory: "/") +!2 = !{} +!3 = !{!4, !5} +!4 = !DIMacro(type: DW_MACINFO_undef, line: 1, name: "X") +!5 = !DIMacroFile(line: 2, file: !6, nodes: !7) +!6 = !DIFile(filename: "t.h", directory: "/") +!7 = !{!8, !9} +!8 = !DIMacro(type: DW_MACINFO_define, line: 3, name: "X", value: "5") +!9 = !DIMacroFile(line: 4, file: !10) +!10 = !DIFile(filename: "t2.h", directory: "/") +!11 = !{i32 2, !"Debug Info Version", i32 3} +!12 = !{!"clang version 4.0.0 (trunk 276746)"}