annotate compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cpp @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 79ff65ed7e25
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clangxx -O0 %s -o %t && %env_tool_opts=stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s
anatofuz
parents:
diff changeset
2 // RUN: %clangxx -O3 %s -o %t && %env_tool_opts=stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s
anatofuz
parents:
diff changeset
3 // RUN: %env_tool_opts=stack_trace_format=frame%n_lineno%l %run %t 2>&1 | FileCheck %s --check-prefix=CUSTOM
anatofuz
parents:
diff changeset
4 // RUN: %env_tool_opts=symbolize_inline_frames=false:stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s --check-prefix=NOINLINE
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
5 // RUN: %env_tool_opts=stack_trace_format='"frame:%n address:%%p"' %run %t 2>&1 | FileCheck %s --check-prefix=NOSYMBOLIZE
150
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 // UNSUPPORTED: darwin
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 // TODO(yln): temporary failing due to refactoring
anatofuz
parents:
diff changeset
10 // UNSUPPORTED: ubsan
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 #include <sanitizer/common_interface_defs.h>
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 static inline void FooBarBaz() {
anatofuz
parents:
diff changeset
15 __sanitizer_print_stack_trace();
anatofuz
parents:
diff changeset
16 }
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 int main() {
anatofuz
parents:
diff changeset
19 FooBarBaz();
anatofuz
parents:
diff changeset
20 return 0;
anatofuz
parents:
diff changeset
21 }
anatofuz
parents:
diff changeset
22 // CHECK: {{ #0 0x.* in __sanitizer_print_stack_trace}}
anatofuz
parents:
diff changeset
23 // CHECK: {{ #1 0x.* in FooBarBaz(\(\))? .*}}print-stack-trace.cpp:[[@LINE-8]]
anatofuz
parents:
diff changeset
24 // CHECK: {{ #2 0x.* in main.*}}print-stack-trace.cpp:[[@LINE-5]]
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 // CUSTOM: frame1_lineno[[@LINE-11]]
anatofuz
parents:
diff changeset
27 // CUSTOM: frame2_lineno[[@LINE-8]]
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 // NOINLINE: #0 0x{{.*}} in __sanitizer_print_stack_trace
anatofuz
parents:
diff changeset
30 // NOINLINE: #1 0x{{.*}} in main{{.*}}print-stack-trace.cpp:[[@LINE-15]]
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
31
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
32 // NOSYMBOLIZE: frame:0 address:{{0x.*}}
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
33 // NOSYMBOLIZE: frame:1 address:{{0x.*}}
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
34 // NOSYMBOLIZE: frame:2 address:{{0x.*}}