[libunwind] [libunwind][test][AIX] Add C API test for unwinding from AIX VAPI (as signal handler) (PR #209662)

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 14 22:52:27 PDT 2026


================
@@ -0,0 +1,107 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+/// Tests unwinding where the signal handler is a VAPI function.
+//
+/// `exit` is used as the signal handler and the unwinding is done in an atexit
+/// handler.
+/// `__builtin_debugtrap` is used because `raise` is also a VAPI function.
+
+/// REQUIRES: target={{.+}}-aix{{.*}}
+/// REQUIRES: has-filecheck
+
+/// ADDITIONAL_COMPILE_FLAGS: -fno-inline -fno-exceptions
+
+/// RUN: %{build}
+/// RUN: %{exec} %t.exe 2>&1 \
+/// RUN: | FileCheck --check-prefix=CHECK \
+/// RUN:       %if libunwind-assertions-enabled %{ --check-prefix=DEBUG %} \
+/// RUN:       %s
----------------
hubert-reinterpretcast wrote:

Fix (intended to use `///` for non-"directive" comments and `//` for "directive" comments):
```suggestion
// REQUIRES: target={{.+}}-aix{{.*}}
// REQUIRES: has-filecheck

// ADDITIONAL_COMPILE_FLAGS: -fno-inline -fno-exceptions

// RUN: %{build}
// RUN: %{exec} %t.exe 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK \
// RUN:       %if libunwind-assertions-enabled %{ --check-prefix=DEBUG %} \
// RUN:       %s
```

https://github.com/llvm/llvm-project/pull/209662


More information about the cfe-commits mailing list