blob: 5672671b3d28b462fc6048416cd2a383ba879a30 [file] [log] [blame]
Eric Christopher9ea300f2017-03-29 23:34:27 +00001; RUN: llc -mtriple=x86_64-unknown-linux-gnu %s -o %t -filetype=obj
Adrian Prantl7bc1b282017-09-11 22:59:45 +00002; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
Eric Christopher9ea300f2017-03-29 23:34:27 +00003;
Brian Gesiaka3985902018-05-21 19:48:27 +00004; Test the DW_AT_producer DWARF attribute.
Eric Christopher9ea300f2017-03-29 23:34:27 +00005; When producer and flags are both given in DIComileUnit, set DW_AT_producer
6; as two values combined.
7;
8; The test splits into two parts, this is LLVM part. The frontend part can be
9; found at llvm/tools/clang/test/Driver/debug-options.c.
10;
11; Generated and reduced from:
12; clang++ -g -grecord-gcc-switches test.cc -S -llvm-emit -o -
13;
14; test.cc:
15; int main() {
16; return 0;
17; }
18
19; CHECK: DW_AT_producer
20; CHECK-SAME: "clang++ -g -grecord-gcc-switches test.cc -S -emit-llvm -o -"
21target triple = "x86_64-unknown-linux-gnu"
22
23define i32 @main() !dbg !6 {
24entry:
25 %retval = alloca i32, align 4
26 store i32 0, i32* %retval, align 4
27 ret i32 0, !dbg !10
28}
29
30!llvm.dbg.cu = !{!0}
31!llvm.module.flags = !{!3, !4}
32!llvm.ident = !{!5}
33
34!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)
35!1 = !DIFile(filename: "test.cc", directory: "d")
36!2 = !{}
37!3 = !{i32 2, !"Dwarf Version", i32 4}
38!4 = !{i32 2, !"Debug Info Version", i32 3}
39!5 = !{!"clang"}
Shiva Chen2c864552018-05-09 02:40:45 +000040!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)
Eric Christopher9ea300f2017-03-29 23:34:27 +000041!7 = !DISubroutineType(types: !8)
42!8 = !{!9}
43!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
44!10 = !DILocation(line: 5, column: 3, scope: !6)