2 //===----------------------------------------------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 // REQUIRES: linux && target={{riscv64-.+}}
14 #include <libunwind.h>
17 __attribute__((noinline
)) extern "C" void stepper() {
21 unw_init_local(&cursor
, &uc
);
22 // Stepping into foo() should succeed.
23 assert(unw_step(&cursor
) > 0);
24 // Stepping past foo() should succeed, too.
25 assert(unw_step(&cursor
) > 0);
28 // Check correct unwinding of frame with VLENB-sized objects (vector registers).
29 __attribute__((noinline
)) static void foo() {
31 asm volatile("" : "=vr"(v
)); // Dummy inline asm to def v.
32 stepper(); // def-use of v has cross the function, so that
33 // will triger spill/reload to/from the stack.
34 asm volatile("" ::"vr"(v
)); // Dummy inline asm to use v.
39 int main() { return 0; }