[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Sema / builtin-stackaddress.c
blobecdc64d899af5d16139e9e9a5f04f094acd3187c
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 void* a(unsigned x) {
4 return __builtin_return_address(0);
7 void b(unsigned x) {
8 return __builtin_return_address(x); // expected-error{{argument to '__builtin_return_address' must be a constant integer}}
11 void* c(unsigned x) {
12 // expected-error@+1 {{argument value 4294967295 is outside the valid range [0, 65535]}}
13 return __builtin_return_address(-1);
16 void* d(unsigned x) {
17 // expected-error@+1 {{argument value 1048575 is outside the valid range [0, 65535]}}
18 return __builtin_return_address(0xFFFFF);
21 void* e(unsigned x) {
22 return __builtin_frame_address(0);
25 void f(unsigned x) {
26 // expected-error@+1 {{argument to '__builtin_frame_address' must be a constant integer}}
27 return __builtin_frame_address(x);
30 void* g(unsigned x) {
31 // expected-error@+1 {{argument value 4294967295 is outside the valid range [0, 65535]}}
32 return __builtin_frame_address(-1);
35 void* h(unsigned x) {
36 // expected-error@+1 {{argument value 1048575 is outside the valid range [0, 65535]}}
37 return __builtin_frame_address(0xFFFFF);