1 // RUN: %clang_cc1 -fsyntax-only -Wframe-address -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -Wmost -verify %s
3 // RUN: %clang_cc1 -x c++ -fsyntax-only -Wframe-address -verify %s
6 return __builtin_return_address(0);
10 return __builtin_return_address(1); // expected-warning{{calling '__builtin_return_address' with a nonzero argument is unsafe}}
14 return __builtin_frame_address(0);
18 return __builtin_frame_address(1); // expected-warning{{calling '__builtin_frame_address' with a nonzero argument is unsafe}}
22 template<int N
> void *RA()
24 return __builtin_return_address(N
); // expected-warning{{calling '__builtin_return_address' with a nonzero argument is unsafe}}
29 return RA
<2>(); // expected-note{{in instantiation of function template specialization 'RA<2>' requested here}}