1 // RUN: %clang_cc1 -x c++ -std=c++1y -fblocks -fsyntax-only -triple %itanium_abi_triple -verify %s
3 // expected-no-diagnostics
6 static_assert(sizeof(__func__
) == 4, "foo");
7 static_assert(sizeof(__FUNCTION__
) == 4, "foo");
8 static_assert(sizeof(__PRETTY_FUNCTION__
) == 11, "auto foo()");
12 auto bar() -> decltype(42) {
13 static_assert(sizeof(__func__
) == 4, "bar");
14 static_assert(sizeof(__FUNCTION__
) == 4, "bar");
15 static_assert(sizeof(__PRETTY_FUNCTION__
) == 10, "int bar()");
22 static_assert(sizeof(__func__
) == 4, "baz");
23 static_assert(sizeof(__FUNCTION__
) == 4, "baz");
24 static_assert(sizeof(__PRETTY_FUNCTION__
) == 20, "int baz() [T = int]");
27 static_assert(sizeof(__func__
) == 11, "operator()");
28 static_assert(sizeof(__FUNCTION__
) == 11, "operator()");
29 static_assert(sizeof(__PRETTY_FUNCTION__
) == 50,
30 "auto baz()::<anonymous class>::operator()() const");
36 static_assert(sizeof(__func__
) == 17, "baz_block_invoke");
37 static_assert(sizeof(__FUNCTION__
) == 17, "baz_block_invoke");
38 static_assert(sizeof(__PRETTY_FUNCTION__
) == 33, "int baz() [T = int]_block_invoke");
41 #pragma clang __debug captured
43 static_assert(sizeof(__func__
) == 4, "baz");
44 static_assert(sizeof(__FUNCTION__
) == 4, "baz");
45 static_assert(sizeof(__PRETTY_FUNCTION__
) == 20, "int baz() [T = int]");
52 static_assert(sizeof(__func__
) == 5, "main");
53 static_assert(sizeof(__FUNCTION__
) == 5, "main");
54 static_assert(sizeof(__PRETTY_FUNCTION__
) == 11, "int main()");
57 static_assert(sizeof(__func__
) == 11, "operator()");
58 static_assert(sizeof(__FUNCTION__
) == 11, "operator()");
59 static_assert(sizeof(__PRETTY_FUNCTION__
) == 51,
60 "auto main()::<anonymous class>::operator()() const");
66 static_assert(sizeof(__func__
) == 18, "main_block_invoke");
67 static_assert(sizeof(__FUNCTION__
) == 18, "main_block_invoke");
68 static_assert(sizeof(__PRETTY_FUNCTION__
) == 24, "int main()_block_invoke");
71 #pragma clang __debug captured
73 static_assert(sizeof(__func__
) == 5, "main");
74 static_assert(sizeof(__FUNCTION__
) == 5, "main");
75 static_assert(sizeof(__PRETTY_FUNCTION__
) == 11, "int main()");
77 #pragma clang __debug captured
79 static_assert(sizeof(__func__
) == 5, "main");
80 static_assert(sizeof(__FUNCTION__
) == 5, "main");
81 static_assert(sizeof(__PRETTY_FUNCTION__
) == 11, "int main()");
86 #pragma clang __debug captured
88 static_assert(sizeof(__func__
) == 11, "operator()");
89 static_assert(sizeof(__FUNCTION__
) == 11, "operator()");
90 static_assert(sizeof(__PRETTY_FUNCTION__
) == 51,
91 "auto main()::<anonymous class>::operator()() const");