xref: /llvm-project/clang/test/Misc/cc1as-debug-format.s (revision 72eee60b2451e8627e492d42bf1d43247685bef9)
1// REQUIRES: x86-registered-target
2/// DWARF32 debug info is produced by default, when neither -gdwarf32 nor -gdwarf64 is given.
3// RUN: %clang -cc1as -triple x86_64-pc-linux-gnu -filetype obj -debug-info-kind=limited -dwarf-version=4 %s -o %t
4// RUN: llvm-dwarfdump -all %t | FileCheck %s --check-prefixes=CHECK,DWARF32
5/// -gdwarf64 causes generating DWARF64 debug info.
6// RUN: %clang -cc1as -triple x86_64-pc-linux-gnu -filetype obj -gdwarf64 -debug-info-kind=limited -dwarf-version=4 %s -o %t
7// RUN: llvm-dwarfdump -all %t | FileCheck %s --check-prefixes=CHECK,DWARF64
8/// -gdwarf32 is also handled and produces DWARF32 debug info.
9// RUN: %clang -cc1as -triple x86_64-pc-linux-gnu -filetype obj -gdwarf32 -debug-info-kind=limited -dwarf-version=4 %s -o %t
10// RUN: llvm-dwarfdump -all %t | FileCheck %s --check-prefixes=CHECK,DWARF32
11
12// CHECK:        .debug_info contents:
13// DWARF32-NEXT: format = DWARF32
14// DWARF64-NEXT: format = DWARF64
15
16// CHECK:        .debug_line contents:
17// CHECK-NEXT:   debug_line[
18// CHECK-NEXT:   Line table prologue:
19// CHECK-NEXT:     total_length:
20// DWARF32-NEXT:     format: DWARF32
21// DWARF64-NEXT:     format: DWARF64
22
23.text
24  nop
25