1 // { dg-options "-std=gnu++0x" }
2 // { dg-do compile }
3 
4 // Copyright (C) 2008-2014 Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library.  This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
11 
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 // GNU General Public License for more details.
16 
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3.  If not see
19 // <http://www.gnu.org/licenses/>.
20 
21 #include <atomic>
22 
23 #ifndef ATOMIC_BOOL_LOCK_FREE
24 # error "ATOMIC_BOOL_LOCK_FREE must be a macro"
25 #endif
26 
27 #ifndef ATOMIC_CHAR_LOCK_FREE
28 # error "ATOMIC_CHAR_LOCK_FREE must be a macro"
29 #endif
30 
31 #ifndef ATOMIC_CHAR16_T_LOCK_FREE
32 # error "ATOMIC_CHAR16_T_LOCK_FREE must be a macro"
33 #endif
34 
35 #ifndef ATOMIC_CHAR32_T_LOCK_FREE
36 # error "ATOMIC_CHAR32_T_LOCK_FREE must be a macro"
37 #endif
38 
39 #ifndef ATOMIC_WCHAR_T_LOCK_FREE
40 # error "ATOMIC_WCHAR_T_LOCK_FREE must be a macro"
41 #endif
42 
43 #ifndef ATOMIC_SHORT_LOCK_FREE
44 # error "ATOMIC_SHORT_LOCK_FREE must be a macro"
45 #endif
46 
47 #ifndef ATOMIC_INT_LOCK_FREE
48 # error "ATOMIC_INT_LOCK_FREE must be a macro"
49 #endif
50 
51 #ifndef ATOMIC_LONG_LOCK_FREE
52 # error "ATOMIC_LONG_LOCK_FREE must be a macro"
53 #endif
54 
55 #ifndef ATOMIC_LLONG_LOCK_FREE
56 # error "ATOMIC_LLONG_LOCK_FREE must be a macro"
57 #endif
58 
59 #ifndef ATOMIC_POINTER_LOCK_FREE
60 # error "ATOMIC_POINTER_LOCK_FREE must be a macro"
61 #endif
62 
63 #ifndef ATOMIC_FLAG_INIT
64     #error "ATOMIC_FLAG_INIT_must_be_a_macro"
65 #endif
66 
67 #ifndef ATOMIC_VAR_INIT
68     #error "ATOMIC_VAR_INIT_must_be_a_macro"
69 #endif
70 
71 
72 extern void abort(void);
73 
74 int main ()
75 {
76 #if (ATOMIC_BOOL_LOCK_FREE != 1 && ATOMIC_BOOL_LOCK_FREE != 2)
77    abort ();
78 #endif
79 
80 #if (ATOMIC_CHAR_LOCK_FREE != 1 && ATOMIC_CHAR_LOCK_FREE != 2)
81    abort ();
82 #endif
83 
84 #if (ATOMIC_CHAR16_T_LOCK_FREE != 1 && ATOMIC_CHAR16_T_LOCK_FREE != 2)
85    abort ();
86 #endif
87 
88 #if (ATOMIC_CHAR32_T_LOCK_FREE != 1 && ATOMIC_CHAR32_T_LOCK_FREE != 2)
89    abort ();
90 #endif
91 
92 #if (ATOMIC_WCHAR_T_LOCK_FREE != 1 && ATOMIC_WCHAR_T_LOCK_FREE != 2)
93    abort ();
94 #endif
95 
96 #if (ATOMIC_SHORT_LOCK_FREE != 1 && ATOMIC_SHORT_LOCK_FREE != 2)
97    abort ();
98 #endif
99 
100 #if (ATOMIC_INT_LOCK_FREE != 1 && ATOMIC_INT_LOCK_FREE != 2)
101    abort ();
102 #endif
103 
104 #if (ATOMIC_LONG_LOCK_FREE != 1 && ATOMIC_LONG_LOCK_FREE != 2)
105    abort ();
106 #endif
107 
108 #if (ATOMIC_LLONG_LOCK_FREE != 1 && ATOMIC_LLONG_LOCK_FREE != 2)
109    abort ();
110 #endif
111 
112 #if (ATOMIC_POINTER_LOCK_FREE != 1 && ATOMIC_POINTER_LOCK_FREE != 2)
113    abort ();
114 #endif
115 }
116