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