1 /// Fast unwinder does not work with Thumb code
2 // UNSUPPORTED: thumb
3 
4 // RUN: %clangxx -fsanitize=return %gmlt -O2 -fno-omit-frame-pointer -fasynchronous-unwind-tables %s -o %t
5 // RUN: %env_ubsan_opts=print_stacktrace=1:fast_unwind_on_fatal=0 not %run %t 2>&1 | FileCheck %s
6 // RUN: %env_ubsan_opts=print_stacktrace=1:fast_unwind_on_fatal=1 not %run %t 2>&1 | FileCheck %s
7 // RUN: %clangxx -fsanitize=return %gmlt -O2 -fno-omit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables %s -o %t
8 // RUN: %env_ubsan_opts=print_stacktrace=1:fast_unwind_on_fatal=0 not %run %t 2>&1 | FileCheck %s
9 // RUN: %env_ubsan_opts=print_stacktrace=1:fast_unwind_on_fatal=1 not %run %t 2>&1 | FileCheck %s
10 
11 // CHECK:      runtime error: execution reached the end of a value-returning function without returning a value
12 // CHECK-NEXT: #0 {{.*}}f() {{.*}}.cpp:[[#@LINE+1]]
13 __attribute__((noinline)) int f() {}
14 
15 // CHECK-NEXT: #1 {{.*}}g() {{.*}}.cpp:[[#@LINE+1]]
16 __attribute__((noinline)) void g() { f(); }
17 
18 // CHECK-NEXT: #2 {{.*}}h() {{.*}}.cpp:[[#@LINE+1]]
19 __attribute__((noinline)) void h() { g(); }
20 
21 // CHECK-NEXT: #3 {{.*}}main {{.*}}.cpp:[[#@LINE+1]]
22 int main() { h(); }
23