1// RUN: %clangxx -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
2
3// Test that symbolizer does not crash on frame with large function name.
4
5// On Darwin LSan reports a false positive
6// UNSUPPORTED: darwin && lsan
7
8#include <sanitizer/common_interface_defs.h>
9#include <vector>
10
11template <int N> struct A {
12 template <class T> void RecursiveTemplateFunction(const T &t);
13};
14
15template <int N>
16template <class T>
17__attribute__((noinline)) void A<N>::RecursiveTemplateFunction(const T &) {
18 std::vector<T> t;
19 return A<N - 1>().RecursiveTemplateFunction(t);
20}
21
22template <>
23template <class T>
24__attribute__((noinline)) void A<0>::RecursiveTemplateFunction(const T &) {
25 __sanitizer_print_stack_trace();
26}
27
28int main() {
29 // CHECK: {{vector<.*vector<.*vector<.*vector<.*vector<}}
30 A<10>().RecursiveTemplateFunction(0);
31}
32

source code of compiler-rt/test/sanitizer_common/TestCases/symbolize_stack.cpp