aboutsummaryrefslogtreecommitdiff
path: root/test/sanitizer_common/TestCases/symbolize_stack.cc
blob: e50cdb0632b334de4b44aa4a60a2bde2cfcc47d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// RUN: %clangxx -O0 %s -o %t && %run %t 2>&1 | FileCheck %s

// Test that symbolizer does not crash on frame with large function name.

#include <sanitizer/common_interface_defs.h>
#include <vector>

template <int N> struct A {
  template <class T> void RecursiveTemplateFunction(const T &t);
};

template <int N>
template <class T>
__attribute__((noinline)) void A<N>::RecursiveTemplateFunction(const T &) {
  std::vector<T> t;
  return A<N - 1>().RecursiveTemplateFunction(t);
}

template <>
template <class T>
__attribute__((noinline)) void A<0>::RecursiveTemplateFunction(const T &) {
  __sanitizer_print_stack_trace();
}

int main() {
  // CHECK: {{vector<.*vector<.*vector<.*vector<.*vector<}}
  A<10>().RecursiveTemplateFunction(0);
}