Michael Buch 3f3bc4853e
[clang][test][DebugInfo] Move debug-info tests from CodeGen to DebugInfo directory (#154311)
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/CodeGen` tests.

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

I created a couple of subdirectories in `clang/test/DebugInfo` where I
thought it made sense (mostly when the tests were target-specific).

There's a couple of tests in `clang/test/CodeGen` 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-19 18:25:13 +01:00

24 lines
1.0 KiB
C

// RUN: %clang_cc1 -x c -std=c89 -fblocks -debug-info-kind=standalone -emit-llvm -O0 \
// RUN: -triple x86_64-apple-darwin -o - %s | FileCheck %s
// RUN: %clang_cc1 -x c -std=c89 -fblocks -debug-info-kind=standalone -emit-llvm -O1 \
// RUN: -triple x86_64-apple-darwin -o - %s \
// RUN: | FileCheck --check-prefix=CHECK-OPT %s
// CHECK: define internal void @__f_block_invoke(ptr noundef %.block_descriptor)
// CHECK: %.block_descriptor.addr = alloca ptr, align 8
// CHECK: %block.addr = alloca ptr, align 8
// CHECK: store ptr %.block_descriptor, ptr %.block_descriptor.addr, align 8
// CHECK: #dbg_declare(ptr %.block_descriptor.addr,
// CHECK-SAME: !DIExpression(),
// CHECK-OPT-NOT: alloca
// Since the block address is not used anywhere in this function,
// the optimizer (DeadArgElim) has replaced all the false uses
// (i.e., metadata users) with poison.
// CHECK-OPT: #dbg_value(ptr poison,
// CHECK-OPT-SAME: !DIExpression(),
void f(void) {
a(^{
b();
});
}