Skip to content

Commit

Permalink
[WebAssembly] Add tests for generic CPU config (llvm#80775)
Browse files Browse the repository at this point in the history
This adds tests for `generic` cpu configuration. We had tests for `mvp`
and `bleeding-edge` configs but not `generic`.
  • Loading branch information
aheejin authored Feb 7, 2024
1 parent bcd1490 commit 4476727
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions clang/test/Preprocessor/wasm-target-features.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,26 @@
// MVP-NOT:#define __wasm_multimemory__
// MVP-NOT:#define __wasm_relaxed_simd__

// RUN: %clang -E -dM %s -o - 2>&1 \
// RUN: -target wasm32-unknown-unknown -mcpu=generic \
// RUN: | FileCheck %s -check-prefix=GENERIC
// RUN: %clang -E -dM %s -o - 2>&1 \
// RUN: -target wasm64-unknown-unknown -mcpu=generic \
// RUN: | FileCheck %s -check-prefix=GENERIC
//
// GENERIC-DAG:#define __wasm_sign_ext__ 1{{$}}
// GENERIC-DAG:#define __wasm_mutable_globals__ 1{{$}}
// GENERIC-NOT:#define __wasm_nontrapping_fptoint__ 1{{$}}
// GENERIC-NOT:#define __wasm_bulk_memory__ 1{{$}}
// GENERIC-NOT:#define __wasm_simd128__ 1{{$}}
// GENERIC-NOT:#define __wasm_atomics__ 1{{$}}
// GENERIC-NOT:#define __wasm_tail_call__ 1{{$}}
// GENERIC-NOT:#define __wasm_multimemory__ 1{{$}}
// GENERIC-NOT:#define __wasm_exception_handling__ 1{{$}}
// GENERIC-NOT:#define __wasm_multivalue__ 1{{$}}
// GENERIC-NOT:#define __wasm_reference_types__ 1{{$}}
// GENERIC-NOT:#define __wasm_extended_const__ 1{{$}}

// RUN: %clang -E -dM %s -o - 2>&1 \
// RUN: -target wasm32-unknown-unknown -mcpu=bleeding-edge \
// RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE
Expand Down

0 comments on commit 4476727

Please sign in to comment.