Mercurial > hg > CbC > CbC_llvm
view libunwind/test/unwind_scalable_vectors.pass.cpp @ 266:00f31e85ec16 default tip
Added tag current for changeset 31d058e83c98
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 14 Oct 2023 10:13:55 +0900 |
parents | 1f2b6ac9f198 |
children |
line wrap: on
line source
// -*- C++ -*- //===----------------------------------------------------------------------===// // // 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 // //===----------------------------------------------------------------------===// // REQUIRES: linux && target={{riscv64-.+}} #undef NDEBUG #include <assert.h> #include <libunwind.h> #ifdef __riscv_vector __attribute__((noinline)) extern "C" void stepper() { unw_cursor_t cursor; unw_context_t uc; unw_getcontext(&uc); unw_init_local(&cursor, &uc); // Stepping into foo() should succeed. assert(unw_step(&cursor) > 0); // Stepping past foo() should succeed, too. assert(unw_step(&cursor) > 0); } // Check correct unwinding of frame with VLENB-sized objects (vector registers). __attribute__((noinline)) static void foo() { __rvv_int32m1_t v; asm volatile("" : "=vr"(v)); // Dummy inline asm to def v. stepper(); // def-use of v has cross the function, so that // will triger spill/reload to/from the stack. asm volatile("" ::"vr"(v)); // Dummy inline asm to use v. } int main() { foo(); } #else int main() { return 0; } #endif