brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1014 B · c5c8eb7 Raw
27 lines · cpp
1// RUN: %clangxx -fsanitize=undefined -O0 %s -o %t && env UBSAN_OPTIONS=stack_trace_format=DEFAULT:fast_unwind_on_fatal=1 %run %t 2>&1 | FileCheck %s2// RUN: %clangxx -fsanitize=undefined -O0 %s -o %t && env UBSAN_OPTIONS=stack_trace_format=DEFAULT:fast_unwind_on_fatal=0 %run %t 2>&1 | FileCheck %s3 4// This test is temporarily disabled due to broken unwinding on ARM.5// UNSUPPORTED: target={{.*-linux-.*}}6 7// Temporarily unsupporting on TySan until interfaces are implemented8// UNSUPPORTED: ubsan-tysan9 10// The test doesn't pass on Darwin in UBSan-TSan configuration, because TSan is11// using the slow unwinder which is not supported on Darwin. The test should12// be universal after landing of https://reviews.llvm.org/D32806.13 14#include <sanitizer/common_interface_defs.h>15 16static inline void FooBarBaz() {17  __sanitizer_print_stack_trace();18}19 20int main() {21  FooBarBaz();22  return 0;23}24 25// CHECK: {{.*}} in FooBarBaz{{.*}}print_stack_trace.cpp{{.*}}26// CHECK: {{.*}} in main{{.*}}print_stack_trace.cpp{{.*}}27