Skip to content

Commit 4476727

Browse files
authored
[WebAssembly] Add tests for generic CPU config (#80775)
This adds tests for `generic` cpu configuration. We had tests for `mvp` and `bleeding-edge` configs but not `generic`.
1 parent bcd1490 commit 4476727

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

clang/test/Preprocessor/wasm-target-features.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,26 @@
146146
// MVP-NOT:#define __wasm_multimemory__
147147
// MVP-NOT:#define __wasm_relaxed_simd__
148148

149+
// RUN: %clang -E -dM %s -o - 2>&1 \
150+
// RUN: -target wasm32-unknown-unknown -mcpu=generic \
151+
// RUN: | FileCheck %s -check-prefix=GENERIC
152+
// RUN: %clang -E -dM %s -o - 2>&1 \
153+
// RUN: -target wasm64-unknown-unknown -mcpu=generic \
154+
// RUN: | FileCheck %s -check-prefix=GENERIC
155+
//
156+
// GENERIC-DAG:#define __wasm_sign_ext__ 1{{$}}
157+
// GENERIC-DAG:#define __wasm_mutable_globals__ 1{{$}}
158+
// GENERIC-NOT:#define __wasm_nontrapping_fptoint__ 1{{$}}
159+
// GENERIC-NOT:#define __wasm_bulk_memory__ 1{{$}}
160+
// GENERIC-NOT:#define __wasm_simd128__ 1{{$}}
161+
// GENERIC-NOT:#define __wasm_atomics__ 1{{$}}
162+
// GENERIC-NOT:#define __wasm_tail_call__ 1{{$}}
163+
// GENERIC-NOT:#define __wasm_multimemory__ 1{{$}}
164+
// GENERIC-NOT:#define __wasm_exception_handling__ 1{{$}}
165+
// GENERIC-NOT:#define __wasm_multivalue__ 1{{$}}
166+
// GENERIC-NOT:#define __wasm_reference_types__ 1{{$}}
167+
// GENERIC-NOT:#define __wasm_extended_const__ 1{{$}}
168+
149169
// RUN: %clang -E -dM %s -o - 2>&1 \
150170
// RUN: -target wasm32-unknown-unknown -mcpu=bleeding-edge \
151171
// RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE

0 commit comments

Comments
 (0)