summaryrefslogtreecommitdiff
path: root/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cc
blob: 341fd7a823b003ff052dbf2f6ab870b22746f23a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// RUN: %clangxx -fsanitize=undefined -O0 %s -o %t && UBSAN_OPTIONS=stack_trace_format=DEFAULT:fast_unwind_on_fatal=1 %run %t 2>&1 | FileCheck %s
// RUN: %clangxx -fsanitize=undefined -O0 %s -o %t && UBSAN_OPTIONS=stack_trace_format=DEFAULT:fast_unwind_on_fatal=0 %run %t 2>&1 | FileCheck %s

// This test is temporarily disabled due to broken unwinding on ARM.
// UNSUPPORTED: -linux-

// The test doesn't pass on Darwin in UBSan-TSan configuration, because TSan is
// using the slow unwinder which is not supported on Darwin. The test should
// be universal after landing of https://reviews.llvm.org/D32806.

#include <sanitizer/common_interface_defs.h>

static inline void FooBarBaz() {
  __sanitizer_print_stack_trace();
}

int main() {
  FooBarBaz();
  return 0;
}

// CHECK: {{.*}} in FooBarBaz{{.*}}print_stack_trace.cc{{.*}}
// CHECK: {{.*}} in main{{.*}}print_stack_trace.cc{{.*}}