Eli Friedman | 6cfda23 | 2008-05-20 08:23:37 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | void* a(unsigned x) { |
| 3 | return __builtin_return_address(0); |
| 4 | } |
| 5 | |
| 6 | void b(unsigned x) { |
| 7 | return __builtin_return_address(x); // expected-error{{the level argument for a stack address builtin must be constant}} |
| 8 | } |
| 9 | |
Eli Friedman | e590a84 | 2008-05-20 08:27:04 +0000 | [diff] [blame] | 10 | void* c(unsigned x) { |
Eli Friedman | 6cfda23 | 2008-05-20 08:23:37 +0000 | [diff] [blame] | 11 | return __builtin_frame_address(0); |
| 12 | } |
| 13 | |
Eli Friedman | e590a84 | 2008-05-20 08:27:04 +0000 | [diff] [blame] | 14 | void d(unsigned x) { |
Eli Friedman | 6cfda23 | 2008-05-20 08:23:37 +0000 | [diff] [blame] | 15 | return __builtin_frame_address(x); // expected-error{{the level argument for a stack address builtin must be constant}} |
| 16 | } |