Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / Darwin / print-stack-trace.cpp
blobe02862d3d412b8b211b1c5a9eaaef72eae1ff844
1 // RUN: %clangxx -O0 %s -o %t && %env_tool_opts=stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s
2 // RUN: %env_tool_opts=stack_trace_format='"frame:%n lineno:%l"' %run %t 2>&1 | FileCheck %s --check-prefix=CUSTOM
4 #include <sanitizer/common_interface_defs.h>
6 static inline void FooBarBaz() {
7 __sanitizer_print_stack_trace();
10 int main() {
11 FooBarBaz();
12 return 0;
14 // CHECK: {{ #0 0x.* in __sanitizer_print_stack_trace}}
15 // CHECK: {{ #1 0x.* in FooBarBaz(\(\))? .*}}print-stack-trace.cpp:[[@LINE-8]]
16 // CHECK: {{ #2 0x.* in main.*}}print-stack-trace.cpp:[[@LINE-5]]
18 // CUSTOM: frame:1 lineno:[[@LINE-11]]
19 // CUSTOM: frame:2 lineno:[[@LINE-8]]