49 lines · plain
1; RUN: llc -mtriple=x86_64-unknown-linux-gnu %s -o %t -filetype=obj2; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s --check-prefix LINUX3; RUN: llc -mtriple=x86_64-apple-macosx %s -o %t -filetype=obj4; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s --check-prefix DARWIN5;6; Test the DW_AT_producer DWARF attribute.7; When producer and flags are both given in DIComileUnit, set DW_AT_producer8; as two values combined.9;10; The test splits into two parts, this is LLVM part. The frontend part can be11; found at llvm/tools/clang/test/Driver/debug-options.c.12;13; Generated and reduced from:14; clang++ -g -grecord-gcc-switches test.cc -S -llvm-emit -o -15;16; test.cc:17; int main() {18; return 0;19; }20 21; LINUX: DW_AT_producer{{.*}}("clang++ -g -grecord-gcc-switches test.cc -S -emit-llvm -o -")22; DARWIN: DW_AT_producer{{.*}}("clang++")23; DARWIN: DW_AT_APPLE_flags{{.*}}("-g -grecord-gcc-switches test.cc -S -emit-llvm -o -")24 25target triple = "x86_64-unknown-linux-gnu"26 27define i32 @main() !dbg !6 {28entry:29 %retval = alloca i32, align 430 store i32 0, ptr %retval, align 431 ret i32 0, !dbg !1032}33 34!llvm.dbg.cu = !{!0}35!llvm.module.flags = !{!3, !4}36!llvm.ident = !{!5}37 38!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang++", isOptimized: false, flags: "-g -grecord-gcc-switches test.cc -S -emit-llvm -o -", runtimeVersion: 0, emissionKind: FullDebug, enums: !2)39!1 = !DIFile(filename: "test.cc", directory: "d")40!2 = !{}41!3 = !{i32 2, !"Dwarf Version", i32 4}42!4 = !{i32 2, !"Debug Info Version", i32 3}43!5 = !{!"clang"}44!6 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 4, type: !7, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)45!7 = !DISubroutineType(types: !8)46!8 = !{!9}47!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)48!10 = !DILocation(line: 5, column: 3, scope: !6)49