Michael Buch f2aedc21f9
[clang][DebugInfo][test] Move debug-info tests from CodeGenCXX to DebugInfo directory (#154538)
This patch works towards consolidating all Clang debug-info into the
`clang/test/DebugInfo` directory
(https://discourse.llvm.org/t/clang-test-location-of-clang-debug-info-tests/87958).

Here we move only the `clang/test/CodeGenCXX` tests. I created a `CXX`
subdirectory for now because many of the tests I checked actually did
seem C++-specific. There is probably overlap between the `Generic` and
`CXX` subdirectory, but I haven't gone through and audited them all.

The list of files i came up with is:
1. searched for anything with `*debug-info*` in the filename
2. searched for occurrences of `debug-info-kind` in the tests

There's a couple of tests in `clang/test/CodeGenCXX` that still set
`-debug-info-kind`. They probably don't need to do that, but I'm not
changing that as part of this PR.
2025-08-21 09:26:08 +01:00

38 lines
1.4 KiB
C++

// REQUIRES: x86-registered-target
// Check that CodeView compiler version is emitted even when debug info is otherwise disabled.
// RUN: %clang --target=i686-pc-windows-msvc -S -emit-llvm %s -o - | FileCheck --check-prefix=IR %s
// IR: !llvm.dbg.cu = !{!0}
// IR: !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "{{.*}}", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug, splitDebugInlining: false, nameTableKind: None)
// RUN: %clang --target=i686-pc-windows-msvc -c %s -o %t.o
// RUN: llvm-readobj --codeview %t.o | FileCheck %s
// CHECK: CodeViewDebugInfo [
// CHECK-NEXT: Section: .debug$S (4)
// CHECK-NEXT: Magic: 0x4
// CHECK-NEXT: Subsection [
// CHECK-NEXT: SubSectionType: Symbols (0xF1)
// CHECK-NEXT: SubSectionSize:
// CHECK-NEXT: ObjNameSym {
// CHECK-NEXT: Kind: S_OBJNAME (0x1101)
// CHECK-NEXT: Signature: 0x0
// CHECK-NEXT: ObjectName:
// CHECK-NEXT: }
// CHECK-NEXT: Compile3Sym {
// CHECK-NEXT: Kind: S_COMPILE3 (0x113C)
// CHECK-NEXT: Language: Cpp (0x1)
// CHECK-NEXT: Flags [ (0x0)
// CHECK-NEXT: ]
// CHECK-NEXT: Machine: Pentium3 (0x7)
// CHECK-NEXT: FrontendVersion:
// CHECK-NEXT: BackendVersion:
// CHECK-NEXT: VersionName: {{.*}}clang version
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: ]
int main() {
return 0;
}