| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-linux-gnu %s |
| 2 |
|
| 3 |
#define NODEREF __attribute__((noderef)) |
| 4 |
|
| 5 |
void Func() { |
| 6 |
int NODEREF i; // expected-warning{{'noderef' can only be used on an array or pointer type}} |
| 7 |
int NODEREF *i_ptr; |
| 8 |
|
| 9 |
// There should be no difference whether a macro defined type is used or not. |
| 10 |
auto __attribute__((noderef)) *auto_i_ptr = i_ptr; |
| 11 |
auto __attribute__((noderef)) auto_i = i; // expected-warning{{'noderef' can only be used on an array or pointer type}} |
| 12 |
|
| 13 |
auto NODEREF *auto_i_ptr2 = i_ptr; |
| 14 |
auto NODEREF auto_i2 = i; // expected-warning{{'noderef' can only be used on an array or pointer type}} |
| 15 |
} |
| 16 |
|
| 17 |
// Added test for fix for P41835 |
| 18 |
#define _LIBCPP_FLOAT_ABI __attribute__((pcs("aapcs"))) |
| 19 |
struct A { |
| 20 |
_LIBCPP_FLOAT_ABI int operator()() throw(); // expected-warning{{'pcs' calling convention is not supported for this target}} |
| 21 |
}; |
| 22 |
|
| 23 |
// Added test for fix for PR43315 |
| 24 |
#define a __attribute__((__cdecl__, __regparm__(0))) |
| 25 |
int(a b)(); |