llvm-project/clang/test/DebugInfo/Generic/ubsan-trap-reason-crash.cpp
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

21 lines
646 B
C++

// FIXME: We should emit a trap message for this case too.
// But sometimes Clang will emit a ubsan trap into the prologue of a function,
// at which point the debug-info locations haven't been set up yet and
// can't hook up our artificial inline frame. [Issue #150707]
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \
// RUN: -fsanitize=null -fsanitize-trap=null -emit-llvm %s -o - | FileCheck %s
struct Foo {
void target() {}
} f;
void caller() {
f.target();
}
// CHECK-LABEL: @_Z6callerv
// CHECK: call void @llvm.ubsantrap(i8 22){{.*}}!nosanitize
// CHECK-NOT: __clang_trap_msg