blob: c030ab364fe9eaea0f938f17491a001c7d43964d [file] [log] [blame]
Eli Friedman6cfda232008-05-20 08:23:37 +00001// RUN: clang -fsyntax-only -verify %s
2void* a(unsigned x) {
3return __builtin_return_address(0);
4}
5
6void b(unsigned x) {
7return __builtin_return_address(x); // expected-error{{the level argument for a stack address builtin must be constant}}
8}
9
Eli Friedmane590a842008-05-20 08:27:04 +000010void* c(unsigned x) {
Eli Friedman6cfda232008-05-20 08:23:37 +000011return __builtin_frame_address(0);
12}
13
Eli Friedmane590a842008-05-20 08:27:04 +000014void d(unsigned x) {
Eli Friedman6cfda232008-05-20 08:23:37 +000015return __builtin_frame_address(x); // expected-error{{the level argument for a stack address builtin must be constant}}
16}