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