1 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv5 %s | FileCheck %s -check-prefix CHECK-V5
2 // CHECK-V5: #define __HEXAGON_ARCH__ 5
3 // CHECK-V5: #define __HEXAGON_V5__ 1
4 // CHECK-V5-NOT: #define __HVX_LENGTH__
5 // CHECK-V5-NOT: #define __HVX__ 1
6 // CHECK-V5: #define __hexagon__ 1
8 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv55 %s | FileCheck %s -check-prefix CHECK-V55
9 // CHECK-V55: #define __HEXAGON_ARCH__ 55
10 // CHECK-V55: #define __HEXAGON_V55__ 1
11 // CHECK-V55-NOT: #define __HVX_LENGTH__
12 // CHECK-V55-NOT: #define __HVX__ 1
13 // CHECK-V55: #define __hexagon__ 1
15 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv60 %s | FileCheck %s -check-prefix CHECK-V60
16 // CHECK-V60: #define __HEXAGON_ARCH__ 60
17 // CHECK-V60: #define __HEXAGON_V60__ 1
18 // CHECK-V60-NOT: #define __HVX_LENGTH__
19 // CHECK-V60-NOT: #define __HVX__ 1
20 // CHECK-V60: #define __hexagon__ 1
22 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv62 %s | FileCheck %s -check-prefix CHECK-V62
23 // CHECK-V62: #define __HEXAGON_ARCH__ 62
24 // CHECK-V62: #define __HEXAGON_V62__ 1
25 // CHECK-V62-NOT: #define __HVX_LENGTH__
26 // CHECK-V62-NOT: #define __HVX__ 1
27 // CHECK-V62: #define __hexagon__ 1
29 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv65 %s | FileCheck %s -check-prefix CHECK-V65
30 // CHECK-V65: #define __HEXAGON_ARCH__ 65
31 // CHECK-V65: #define __HEXAGON_V65__ 1
32 // CHECK-V65-NOT: #define __HVX_LENGTH__
33 // CHECK-V65-NOT: #define __HVX__ 1
34 // CHECK-V65: #define __hexagon__ 1
36 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv66 %s | FileCheck %s -check-prefix CHECK-V66
37 // CHECK-V66: #define __HEXAGON_ARCH__ 66
38 // CHECK-V66: #define __HEXAGON_V66__ 1
39 // CHECK-V66-NOT: #define __HVX_LENGTH__
40 // CHECK-V66-NOT: #define __HVX__ 1
41 // CHECK-V66: #define __hexagon__ 1
43 // The HVX flags are explicitly defined by the driver.
44 // For v60,v62,v65 - 64B mode is default
45 // For v66 and future archs - 128B is default
46 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv60 \
47 // RUN: -target-feature +hvxv60 -target-feature +hvx-length64b %s | FileCheck \
48 // RUN: %s -check-prefix CHECK-V60HVX-64B
49 // CHECK-V60HVX-64B: #define __HEXAGON_ARCH__ 60
50 // CHECK-V60HVX-64B: #define __HEXAGON_V60__ 1
51 // CHECK-V60HVX-64B-NOT: #define __HVXDBL__ 1
52 // CHECK-V60HVX-64B: #define __HVX_ARCH__ 60
53 // CHECK-V60HVX-64B: #define __HVX_LENGTH__ 64
54 // CHECK-V60HVX-64B: #define __HVX__ 1
55 // CHECK-V60HVX-64B: #define __hexagon__ 1
57 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv60 \
58 // RUN: -target-feature +hvxv60 -target-feature +hvx-length128b %s | FileCheck \
59 // RUN: %s -check-prefix CHECK-V60HVX-128B
60 // CHECK-V60HVX-128B: #define __HEXAGON_ARCH__ 60
61 // CHECK-V60HVX-128B: #define __HEXAGON_V60__ 1
62 // CHECK-V60HVX-128B: #define __HVXDBL__ 1
63 // CHECK-V60HVX-128B: #define __HVX_ARCH__ 60
64 // CHECK-V60HVX-128B: #define __HVX_LENGTH__ 128
65 // CHECK-V60HVX-128B: #define __HVX__ 1
66 // CHECK-V60HVX-128B: #define __hexagon__ 1
68 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv66 \
69 // RUN: -target-feature +hvxv66 -target-feature +hvx-length64b %s | FileCheck \
70 // RUN: %s -check-prefix CHECK-V66HVX-64B
71 // CHECK-V66HVX-64B: #define __HEXAGON_ARCH__ 66
72 // CHECK-V66HVX-64B: #define __HEXAGON_V66__ 1
73 // CHECK-V66HVX-64B-NOT: #define __HVXDBL__ 1
74 // CHECK-V66HVX-64B: #define __HVX_ARCH__ 66
75 // CHECK-V66HVX-64B: #define __HVX_LENGTH__ 64
76 // CHECK-V66HVX-64B: #define __HVX__ 1
77 // CHECK-V66HVX-64B: #define __hexagon__ 1
79 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv66 \
80 // RUN: -target-feature +hvxv66 -target-feature +hvx-length128b %s | FileCheck \
81 // RUN: %s -check-prefix CHECK-V66HVX-128B
82 // CHECK-V66HVX-128B: #define __HEXAGON_ARCH__ 66
83 // CHECK-V66HVX-128B: #define __HEXAGON_V66__ 1
84 // CHECK-V66HVX-128B: #define __HVXDBL__ 1
85 // CHECK-V66HVX-128B: #define __HVX_ARCH__ 66
86 // CHECK-V66HVX-128B: #define __HVX_LENGTH__ 128
87 // CHECK-V66HVX-128B: #define __HVX__ 1
88 // CHECK-V66HVX-128B: #define __hexagon__ 1
90 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv67 \
91 // RUN: -target-feature +hvxv67 -target-feature +hvx-length128b %s | FileCheck \
92 // RUN: %s -check-prefix CHECK-V67HVX-128B
93 // CHECK-V67HVX-128B: #define __HEXAGON_ARCH__ 67
94 // CHECK-V67HVX-128B: #define __HEXAGON_V67__ 1
95 // CHECK-V67HVX-128B: #define __HVX_ARCH__ 67
96 // CHECK-V67HVX-128B: #define __HVX_LENGTH__ 128
97 // CHECK-V67HVX-128B: #define __HVX__ 1
98 // CHECK-V67HVX-128B: #define __hexagon__ 1
100 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv68 \
101 // RUN: -target-feature +hvxv68 -target-feature +hvx-length128b %s | FileCheck \
102 // RUN: %s -check-prefix CHECK-V68HVX-128B
103 // CHECK-V68HVX-128B: #define __HEXAGON_ARCH__ 68
104 // CHECK-V68HVX-128B: #define __HEXAGON_V68__ 1
105 // CHECK-V68HVX-128B: #define __HVX_ARCH__ 68
106 // CHECK-V68HVX-128B: #define __HVX_LENGTH__ 128
107 // CHECK-V68HVX-128B: #define __HVX__ 1
108 // CHECK-V68HVX-128B: #define __hexagon__ 1
110 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv69 \
111 // RUN: -target-feature +hvxv69 -target-feature +hvx-length128b %s | FileCheck \
112 // RUN: %s -check-prefix CHECK-V69HVX-128B
113 // CHECK-V69HVX-128B: #define __HEXAGON_ARCH__ 69
114 // CHECK-V69HVX-128B: #define __HEXAGON_V69__ 1
115 // CHECK-V69HVX-128B: #define __HVX_ARCH__ 69
116 // CHECK-V69HVX-128B: #define __HVX_LENGTH__ 128
117 // CHECK-V69HVX-128B: #define __HVX__ 1
118 // CHECK-V69HVX-128B: #define __hexagon__ 1
120 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv71 \
121 // RUN: -target-feature +hvxv71 -target-feature +hvx-length128b %s | FileCheck \
122 // RUN: %s -check-prefix CHECK-V71HVX-128B
123 // CHECK-V71HVX-128B: #define __HEXAGON_ARCH__ 71
124 // CHECK-V71HVX-128B: #define __HEXAGON_V71__ 1
125 // CHECK-V71HVX-128B: #define __HVX_ARCH__ 71
126 // CHECK-V71HVX-128B: #define __HVX_LENGTH__ 128
127 // CHECK-V71HVX-128B: #define __HVX__ 1
128 // CHECK-V71HVX-128B: #define __hexagon__ 1
130 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv73 \
131 // RUN: -target-feature +hvxv73 -target-feature +hvx-length128b %s | FileCheck \
132 // RUN: %s -check-prefix CHECK-V73HVX-128B
133 // CHECK-V73HVX-128B: #define __HEXAGON_ARCH__ 73
134 // CHECK-V73HVX-128B: #define __HEXAGON_V73__ 1
135 // CHECK-V73HVX-128B: #define __HVX_ARCH__ 73
136 // CHECK-V73HVX-128B: #define __HVX_LENGTH__ 128
137 // CHECK-V73HVX-128B: #define __HVX__ 1
138 // CHECK-V73HVX-128B: #define __hexagon__ 1
141 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv67 \
142 // RUN: -target-feature +hvxv67 -target-feature +hvx-length128b %s | FileCheck \
143 // RUN: %s -check-prefix CHECK-ELF
144 // CHECK-ELF: #define __ELF__ 1
146 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-linux-musl \
147 // RUN: -target-cpu hexagonv67 -target-feature +hvxv67 \
148 // RUN: -target-feature +hvx-length128b %s | FileCheck \
149 // RUN: %s -check-prefix CHECK-LINUX
150 // CHECK-LINUX: #define __gnu_linux__ 1
151 // CHECK-LINUX: #define __linux 1
152 // CHECK-LINUX: #define __linux__ 1
153 // CHECK-LINUX: #define __unix 1
154 // CHECK-LINUX: #define __unix__ 1
155 // CHECK-LINUX: #define linux 1
156 // CHECK-LINUX: #define unix 1
158 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-linux-musl \
159 // RUN: -target-cpu hexagonv67 -target-feature +hvxv67 \
160 // RUN: -target-feature +hvx-length128b %s | FileCheck \
161 // RUN: %s -check-prefix CHECK-ATOMIC
162 // CHECK-ATOMIC: #define __CLANG_ATOMIC_BOOL_LOCK_FREE 2
163 // CHECK-ATOMIC: #define __CLANG_ATOMIC_CHAR16_T_LOCK_FREE 2
164 // CHECK-ATOMIC: #define __CLANG_ATOMIC_CHAR32_T_LOCK_FREE 2
165 // CHECK-ATOMIC: #define __CLANG_ATOMIC_CHAR_LOCK_FREE 2
166 // CHECK-ATOMIC: #define __CLANG_ATOMIC_INT_LOCK_FREE 2
167 // CHECK-ATOMIC: #define __CLANG_ATOMIC_LLONG_LOCK_FREE 2
168 // CHECK-ATOMIC: #define __CLANG_ATOMIC_LONG_LOCK_FREE 2
169 // CHECK-ATOMIC: #define __CLANG_ATOMIC_POINTER_LOCK_FREE 2
170 // CHECK-ATOMIC: #define __CLANG_ATOMIC_SHORT_LOCK_FREE 2
171 // CHECK-ATOMIC: #define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2
173 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-linux-musl \
174 // RUN: -target-cpu hexagonv67 | FileCheck \
175 // RUN: %s -check-prefix CHECK-INTERFERENCE
176 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-none-elf \
177 // RUN: -target-cpu hexagonv67 | FileCheck \
178 // RUN: %s -check-prefix CHECK-INTERFERENCE
179 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-none-elf \
180 // RUN: -target-cpu hexagonv71t | FileCheck \
181 // RUN: %s -check-prefix CHECK-INTERFERENCE
182 // CHECK-INTERFERENCE: #define __GCC_CONSTRUCTIVE_SIZE 32
183 // CHECK-INTERFERENCE: #define __GCC_DESTRUCTIVE_SIZE 32
184 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-none-elf \
185 // RUN: -target-cpu hexagonv73 | FileCheck \
186 // RUN: %s -check-prefix CHECK-INTERFERENCE-73
187 // CHECK-INTERFERENCE-73: #define __GCC_CONSTRUCTIVE_SIZE 64
188 // CHECK-INTERFERENCE-73: #define __GCC_DESTRUCTIVE_SIZE 64