1 // -*- C++ -*- 2 //===----------------------------------------------------------------------===// 3 // 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 7 // 8 //===----------------------------------------------------------------------===// 9 10 // Ensure that functions marked as signal frames are reported as such. 11 12 #include <assert.h> 13 #include <stdlib.h> 14 #include <libunwind.h> 15 16 int main(void) { 17 asm(".cfi_signal_frame"); 18 unw_cursor_t cursor; 19 unw_context_t uc; 20 unw_getcontext(&uc); 21 unw_init_local(&cursor, &uc); 22 assert(unw_step(&cursor) > 0); 23 assert(unw_is_signal_frame(&cursor)); 24 return 0; 25 } 26