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 | |
11 | template <int N> struct A { |
12 | template <class T> void RecursiveTemplateFunction(const T &t); |
13 | }; |
14 | |
15 | template <int N> |
16 | template <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 | |
22 | template <> |
23 | template <class T> |
24 | __attribute__((noinline)) void A<0>::RecursiveTemplateFunction(const T &) { |
25 | __sanitizer_print_stack_trace(); |
26 | } |
27 | |
28 | int main() { |
29 | // CHECK: {{vector<.*vector<.*vector<.*vector<.*vector<}} |
30 | A<10>().RecursiveTemplateFunction(0); |
31 | } |
32 | |