Eric Christopher | 9ea300f | 2017-03-29 23:34:27 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=x86_64-unknown-linux-gnu %s -o %t -filetype=obj |
Adrian Prantl | 7bc1b28 | 2017-09-11 22:59:45 +0000 | [diff] [blame] | 2 | ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s |
Eric Christopher | 9ea300f | 2017-03-29 23:34:27 +0000 | [diff] [blame] | 3 | ; |
Brian Gesiak | a398590 | 2018-05-21 19:48:27 +0000 | [diff] [blame] | 4 | ; Test the DW_AT_producer DWARF attribute. |
Eric Christopher | 9ea300f | 2017-03-29 23:34:27 +0000 | [diff] [blame] | 5 | ; 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 -" |
| 21 | target triple = "x86_64-unknown-linux-gnu" |
| 22 | |
| 23 | define i32 @main() !dbg !6 { |
| 24 | entry: |
| 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 Chen | 2c86455 | 2018-05-09 02:40:45 +0000 | [diff] [blame] | 40 | !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 Christopher | 9ea300f | 2017-03-29 23:34:27 +0000 | [diff] [blame] | 41 | !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) |