1 ; This checks cases when the 64-bit DWARF debug info should not be generated
2 ; even if '-dwarf64' is specified.
4 ; The 64-bit DWARF format was introduced in DWARFv3, so the '-dwarf64' switch
5 ; should be ignored for earlier versions.
6 ; RUN: llc -mtriple=x86_64 -dwarf-version=2 -dwarf64 -filetype=obj %s -o - | \
7 ; RUN: llvm-dwarfdump -debug-line - | \
8 ; RUN: FileCheck %s --check-prefixes=ELF64,CHECK
10 ; DWARF64 requires 64-bit relocations, so it is not produced for 32-bit targets.
11 ; RUN: llc -mtriple=i386 -dwarf-version=5 -dwarf64 -filetype=obj %s -o - | \
12 ; RUN: llvm-dwarfdump -debug-line - | \
13 ; RUN: FileCheck %s --check-prefixes=ELF32,CHECK
15 ; DWARF64 is enabled only for ELF targets. The switch should be ignored for COFF.
16 ; RUN: llc -mtriple=x86_64-windows-gnu -dwarf-version=5 -dwarf64 -filetype=obj %s -o - | \
17 ; RUN: llvm-dwarfdump -debug-line - | \
18 ; RUN: FileCheck %s --check-prefixes=COFF,CHECK
20 ; DWARF64 is enabled only for ELF targets. The switch should be ignored for Mach-O.
21 ; RUN: llc -mtriple=x86_64-apple-darwin -dwarf-version=5 -dwarf64 -filetype=obj %s -o - | \
22 ; RUN: llvm-dwarfdump -debug-line - | \
23 ; RUN: FileCheck %s --check-prefixes=MACHO,CHECK
25 ; ELF64: file format elf64-x86-64
26 ; ELF32: file format elf32-i386
27 ; COFF: file format COFF-x86-64
28 ; MACHO: file format Mach-O 64-bit x86-64
30 ; CHECK: .debug_line contents:
31 ; CHECK-NEXT: debug_line[0x00000000]
32 ; CHECK-NEXT: Line table prologue:
33 ; CHECK-NEXT: total_length:
34 ; CHECK-NEXT: format: DWARF32
36 ; IR generated and reduced from:
39 ; $ clang -g -S -emit-llvm foo.c -o foo.ll
41 target triple = "x86_64-unknown-linux-gnu"
43 @foo = dso_local global i32 0, align 4, !dbg !0
46 !llvm.module.flags = !{!7, !8, !9}
49 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
50 !1 = distinct !DIGlobalVariable(name: "foo", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
51 !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 12.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, splitDebugInlining: false, nameTableKind: None)
52 !3 = !DIFile(filename: "foo.c", directory: "/tmp")
55 !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
56 !7 = !{i32 7, !"Dwarf Version", i32 4}
57 !8 = !{i32 2, !"Debug Info Version", i32 3}
58 !9 = !{i32 1, !"wchar_size", i32 4}
59 !10 = !{!"clang version 12.0.0"}