Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Preprocessor / wasm-target-features.c
blobc225e226b69ba14e821249e5753141d6b60d1bf9
1 // RUN: %clang -E -dM %s -o - 2>&1 \
2 // RUN: -target wasm32-unknown-unknown -msimd128 \
3 // RUN: | FileCheck %s -check-prefix=SIMD128
4 // RUN: %clang -E -dM %s -o - 2>&1 \
5 // RUN: -target wasm64-unknown-unknown -msimd128 \
6 // RUN: | FileCheck %s -check-prefix=SIMD128
7 //
8 // SIMD128:#define __wasm_simd128__ 1{{$}}
10 // RUN: %clang -E -dM %s -o - 2>&1 \
11 // RUN: -target wasm32-unknown-unknown -mrelaxed-simd \
12 // RUN: | FileCheck %s -check-prefix=RELAXED-SIMD
13 // RUN: %clang -E -dM %s -o - 2>&1 \
14 // RUN: -target wasm64-unknown-unknown -mrelaxed-simd \
15 // RUN: | FileCheck %s -check-prefix=RELAXED-SIMD
17 // RELAXED-SIMD:#define __wasm_relaxed_simd__ 1{{$}}
19 // RUN: %clang -E -dM %s -o - 2>&1 \
20 // RUN: -target wasm32-unknown-unknown -mnontrapping-fptoint \
21 // RUN: | FileCheck %s -check-prefix=NONTRAPPING-FPTOINT
22 // RUN: %clang -E -dM %s -o - 2>&1 \
23 // RUN: -target wasm64-unknown-unknown -mnontrapping-fptoint \
24 // RUN: | FileCheck %s -check-prefix=NONTRAPPING-FPTOINT
26 // NONTRAPPING-FPTOINT:#define __wasm_nontrapping_fptoint__ 1{{$}}
28 // RUN: %clang -E -dM %s -o - 2>&1 \
29 // RUN: -target wasm32-unknown-unknown -msign-ext \
30 // RUN: | FileCheck %s -check-prefix=SIGN-EXT
31 // RUN: %clang -E -dM %s -o - 2>&1 \
32 // RUN: -target wasm64-unknown-unknown -msign-ext \
33 // RUN: | FileCheck %s -check-prefix=SIGN-EXT
35 // SIGN-EXT:#define __wasm_sign_ext__ 1{{$}}
37 // RUN: %clang -E -dM %s -o - 2>&1 \
38 // RUN: -target wasm32-unknown-unknown -mexception-handling \
39 // RUN: | FileCheck %s -check-prefix=EXCEPTION-HANDLING
40 // RUN: %clang -E -dM %s -o - 2>&1 \
41 // RUN: -target wasm64-unknown-unknown -mexception-handling \
42 // RUN: | FileCheck %s -check-prefix=EXCEPTION-HANDLING
44 // EXCEPTION-HANDLING:#define __wasm_exception_handling__ 1{{$}}
46 // RUN: %clang -E -dM %s -o - 2>&1 \
47 // RUN: -target wasm32-unknown-unknown -mbulk-memory \
48 // RUN: | FileCheck %s -check-prefix=BULK-MEMORY
49 // RUN: %clang -E -dM %s -o - 2>&1 \
50 // RUN: -target wasm64-unknown-unknown -mbulk-memory \
51 // RUN: | FileCheck %s -check-prefix=BULK-MEMORY
53 // BULK-MEMORY:#define __wasm_bulk_memory__ 1{{$}}
55 // RUN: %clang -E -dM %s -o - 2>&1 \
56 // RUN: -target wasm32-unknown-unknown -matomics \
57 // RUN: | FileCheck %s -check-prefix=ATOMICS
58 // RUN: %clang -E -dM %s -o - 2>&1 \
59 // RUN: -target wasm64-unknown-unknown -matomics \
60 // RUN: | FileCheck %s -check-prefix=ATOMICS
62 // ATOMICS:#define __wasm_atomics__ 1{{$}}
64 // RUN: %clang -E -dM %s -o - 2>&1 \
65 // RUN: -target wasm32-unknown-unknown -pthread \
66 // RUN: | FileCheck %s -check-prefix=PTHREAD
67 // RUN: %clang -E -dM %s -o - 2>&1 \
68 // RUN: -target wasm64-unknown-unknown -pthread \
69 // RUN: | FileCheck %s -check-prefix=PTHREAD
71 // PTHREAD:#define __wasm_atomics__ 1{{$}}
73 // RUN: %clang -E -dM %s -o - 2>&1 \
74 // RUN: -target wasm32-unknown-unknown -mmutable-globals \
75 // RUN: | FileCheck %s -check-prefix=MUTABLE-GLOBALS
76 // RUN: %clang -E -dM %s -o - 2>&1 \
77 // RUN: -target wasm64-unknown-unknown -mmutable-globals \
78 // RUN: | FileCheck %s -check-prefix=MUTABLE-GLOBALS
80 // MUTABLE-GLOBALS:#define __wasm_mutable_globals__ 1{{$}}
82 // RUN: %clang -E -dM %s -o - 2>&1 \
83 // RUN: -target wasm32-unknown-unknown -mmultivalue \
84 // RUN: | FileCheck %s -check-prefix=MULTIVALUE
85 // RUN: %clang -E -dM %s -o - 2>&1 \
86 // RUN: -target wasm64-unknown-unknown -mmultivalue \
87 // RUN: | FileCheck %s -check-prefix=MULTIVALUE
89 // MULTIVALUE:#define __wasm_multivalue__ 1{{$}}
91 // RUN: %clang -E -dM %s -o - 2>&1 \
92 // RUN: -target wasm32-unknown-unknown -mtail-call \
93 // RUN: | FileCheck %s -check-prefix=TAIL-CALL
94 // RUN: %clang -E -dM %s -o - 2>&1 \
95 // RUN: -target wasm64-unknown-unknown -mtail-call \
96 // RUN: | FileCheck %s -check-prefix=TAIL-CALL
98 // TAIL-CALL:#define __wasm_tail_call__ 1{{$}}
100 // RUN: %clang -E -dM %s -o - 2>&1 \
101 // RUN: -target wasm32-unknown-unknown -mreference-types \
102 // RUN: | FileCheck %s -check-prefix=REFERENCE-TYPES
103 // RUN: %clang -E -dM %s -o - 2>&1 \
104 // RUN: -target wasm64-unknown-unknown -mreference-types \
105 // RUN: | FileCheck %s -check-prefix=REFERENCE-TYPES
107 // REFERENCE-TYPES:#define __wasm_reference_types__ 1{{$}}
109 // RUN: %clang -E -dM %s -o - 2>&1 \
110 // RUN: -target wasm32-unknown-unknown -mextended-const \
111 // RUN: | FileCheck %s -check-prefix=EXTENDED-CONST
112 // RUN: %clang -E -dM %s -o - 2>&1 \
113 // RUN: -target wasm64-unknown-unknown -mextended-const \
114 // RUN: | FileCheck %s -check-prefix=EXTENDED-CONST
116 // EXTENDED-CONST:#define __wasm_extended_const__ 1{{$}}
118 // RUN: %clang -E -dM %s -o - 2>&1 \
119 // RUN: -target wasm32-unknown-unknown -mmultimemory \
120 // RUN: | FileCheck %s -check-prefix=MULTIMEMORY
121 // RUN: %clang -E -dM %s -o - 2>&1 \
122 // RUN: -target wasm64-unknown-unknown -mmultimemory \
123 // RUN: | FileCheck %s -check-prefix=MULTIMEMORY
125 // MULTIMEMORY:#define __wasm_multimemory__ 1{{$}}
128 // RUN: %clang -E -dM %s -o - 2>&1 \
129 // RUN: -target wasm32-unknown-unknown -mcpu=mvp \
130 // RUN: | FileCheck %s -check-prefix=MVP
131 // RUN: %clang -E -dM %s -o - 2>&1 \
132 // RUN: -target wasm64-unknown-unknown -mcpu=mvp \
133 // RUN: | FileCheck %s -check-prefix=MVP
135 // MVP-NOT:#define __wasm_simd128__
136 // MVP-NOT:#define __wasm_nontrapping_fptoint__
137 // MVP-NOT:#define __wasm_sign_ext__
138 // MVP-NOT:#define __wasm_exception_handling__
139 // MVP-NOT:#define __wasm_bulk_memory__
140 // MVP-NOT:#define __wasm_atomics__
141 // MVP-NOT:#define __wasm_mutable_globals__
142 // MVP-NOT:#define __wasm_multivalue__
143 // MVP-NOT:#define __wasm_tail_call__
144 // MVP-NOT:#define __wasm_reference_types__
145 // MVP-NOT:#define __wasm_extended_const__
146 // MVP-NOT:#define __wasm_multimemory__
148 // RUN: %clang -E -dM %s -o - 2>&1 \
149 // RUN: -target wasm32-unknown-unknown -mcpu=bleeding-edge \
150 // RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE
151 // RUN: %clang -E -dM %s -o - 2>&1 \
152 // RUN: -target wasm64-unknown-unknown -mcpu=bleeding-edge \
153 // RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE
155 // BLEEDING-EDGE-DAG:#define __wasm_nontrapping_fptoint__ 1{{$}}
156 // BLEEDING-EDGE-DAG:#define __wasm_sign_ext__ 1{{$}}
157 // BLEEDING-EDGE-DAG:#define __wasm_bulk_memory__ 1{{$}}
158 // BLEEDING-EDGE-DAG:#define __wasm_simd128__ 1{{$}}
159 // BLEEDING-EDGE-DAG:#define __wasm_atomics__ 1{{$}}
160 // BLEEDING-EDGE-DAG:#define __wasm_mutable_globals__ 1{{$}}
161 // BLEEDING-EDGE-DAG:#define __wasm_tail_call__ 1{{$}}
162 // BLEEDING-EDGE-DAG:#define __wasm_multimemory__ 1{{$}}
163 // BLEEDING-EDGE-NOT:#define __wasm_unimplemented_simd128__ 1{{$}}
164 // BLEEDING-EDGE-NOT:#define __wasm_exception_handling__ 1{{$}}
165 // BLEEDING-EDGE-NOT:#define __wasm_multivalue__ 1{{$}}
166 // BLEEDING-EDGE-NOT:#define __wasm_reference_types__ 1{{$}}
167 // BLEEDING-EDGE-NOT:#define __wasm_extended_const__ 1{{$}}
169 // RUN: %clang -E -dM %s -o - 2>&1 \
170 // RUN: -target wasm32-unknown-unknown -mcpu=bleeding-edge -mno-simd128 \
171 // RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE-NO-SIMD128
172 // RUN: %clang -E -dM %s -o - 2>&1 \
173 // RUN: -target wasm64-unknown-unknown -mcpu=bleeding-edge -mno-simd128 \
174 // RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE-NO-SIMD128
176 // BLEEDING-EDGE-NO-SIMD128-NOT:#define __wasm_simd128__