Andrew Top | 61a8495 | 2019-04-30 15:07:33 -0700 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c11 %s -fsyntax-only -verify -pedantic |
| 2 | |
| 3 | typedef _Atomic(int) atomic_int; |
| 4 | typedef _Atomic int atomic_int; |
| 5 | typedef _Atomic _Atomic _Atomic(int) atomic_int; // expected-warning {{duplicate '_Atomic' declaration specifier}} |
| 6 | |
| 7 | typedef const int const_int; |
| 8 | |
| 9 | typedef const atomic_int const_atomic_int; |
| 10 | typedef _Atomic const int const_atomic_int; |
| 11 | typedef const _Atomic int const_atomic_int; |
| 12 | typedef const _Atomic(int) const_atomic_int; |
| 13 | typedef const _Atomic(_Atomic int) const_atomic_int; // expected-error {{_Atomic cannot be applied to atomic type '_Atomic(int)'}} |
| 14 | typedef _Atomic const_int const_atomic_int; |
| 15 | typedef _Atomic(const_int) const_atomic_int; // expected-error {{_Atomic cannot be applied to qualified type 'const_int' (aka 'const int')}} |
| 16 | |
| 17 | typedef int *_Atomic atomic_int_ptr; |
| 18 | typedef _Atomic(int *) atomic_int_ptr; |
| 19 | typedef int (*_Atomic atomic_int_ptr); |
| 20 | |
| 21 | typedef int _Atomic *int_atomic_ptr; |
| 22 | typedef _Atomic(int) *int_atomic_ptr; |
| 23 | |
| 24 | typedef int int_fn(); |
| 25 | typedef _Atomic int_fn atomic_int_fn; // expected-error {{_Atomic cannot be applied to function type 'int_fn' (aka 'int ()')}} |
| 26 | typedef _Atomic int atomic_int_array[3]; |
| 27 | typedef _Atomic atomic_int_array atomic_int_atomic_array; // expected-error {{_Atomic cannot be applied to array type 'atomic_int_array' (aka '_Atomic(int) [3]')}} |
| 28 | |
| 29 | _Atomic struct S { int n; }; // expected-warning {{'_Atomic' ignored on this declaration}} |
| 30 | |
| 31 | typedef _Atomic int __attribute__((address_space(1))) atomic_addr_space_int; |
| 32 | typedef _Atomic(int) __attribute__((address_space(1))) atomic_addr_space_int; |
| 33 | |
| 34 | typedef _Atomic int __attribute__((vector_size(16))) atomic_vector_int; |
| 35 | typedef _Atomic(int __attribute__((vector_size(16)))) atomic_vector_int; |
| 36 | |
| 37 | struct S |
| 38 | _Atomic atomic_s_no_missing_semicolon; |
| 39 | |
| 40 | int *const _Atomic atomic_return_type(); |