39 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3void* a(unsigned x) {4return __builtin_return_address(0);5}6 7void b(unsigned x) {8return __builtin_return_address(x); // expected-error{{argument to '__builtin_return_address' must be a constant integer}}9}10 11void* c(unsigned x) {12// expected-error@+1 {{argument value 4294967295 is outside the valid range [0, 65535]}}13return __builtin_return_address(-1);14}15 16void* d(unsigned x) {17// expected-error@+1 {{argument value 1048575 is outside the valid range [0, 65535]}}18return __builtin_return_address(0xFFFFF);19}20 21void* e(unsigned x) {22return __builtin_frame_address(0);23}24 25void f(unsigned x) {26// expected-error@+1 {{argument to '__builtin_frame_address' must be a constant integer}}27return __builtin_frame_address(x);28}29 30void* g(unsigned x) {31// expected-error@+1 {{argument value 4294967295 is outside the valid range [0, 65535]}}32return __builtin_frame_address(-1);33}34 35void* h(unsigned x) {36// expected-error@+1 {{argument value 1048575 is outside the valid range [0, 65535]}}37return __builtin_frame_address(0xFFFFF);38}39