Skip to content

Commit ce00fdc

Browse files
authored
[WebAssembly] Cleanup feature tests (#80780)
This adds missing features to the tests and removes a stale feature (unimplemented_simd128) from them.
1 parent c6691f6 commit ce00fdc

File tree

2 files changed

+82
-1
lines changed

2 files changed

+82
-1
lines changed

clang/test/Driver/wasm-features.c

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@
4242
// MVP-NOT: "-target-feature" "+nontrapping-fptoint"
4343
// BLEEDING-EDGE-NOT: "-target-feature" "-nontrapping-fptoint"
4444

45+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mmultivalue 2>&1 | FileCheck %s -check-prefix=MULTIVALUE
46+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mno-multivalue 2>&1 | FileCheck %s -check-prefix=NO-MULTIVALUE
47+
48+
// MULTIVALUE: "-target-feature" "+multivalue"
49+
// NO-MULTIVALUE: "-target-feature" "-multivalue"
50+
// DEFAULT-NOT: "-target-feature" "-multivalue"
51+
// MVP-NOT: "-target-feature" "+multivalue"
52+
// GENERIC-NOT: "-target-feature" "+multivalue"
53+
// BLEEDING-EDGE-NOT: "-target-feature" "-multivalue"
54+
4555
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mmultimemory 2>&1 | FileCheck %s -check-prefix=MULTIMEMORY
4656
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mno-multimemory 2>&1 | FileCheck %s -check-prefix=NO-MULTIMEMORY
4757

@@ -50,3 +60,73 @@
5060
// DEFAULT-NOT: "-target-feature" "-multimemory"
5161
// MVP-NOT: "-target-feature" "+multimemory"
5262
// BLEEDING-EDGE-NOT: "-target-feature" "-multimemory"
63+
64+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -matomics 2>&1 | FileCheck %s -check-prefix=ATOMICS
65+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mno-atomics 2>&1 | FileCheck %s -check-prefix=NO-ATOMICS
66+
67+
// ATOMICS: "-target-feature" "+atomics"
68+
// NO-ATOMICS: "-target-feature" "-atomics"
69+
// DEFAULT-NOT: "-target-feature" "-atomics"
70+
// MVP-NOT: "-target-feature" "+atomics"
71+
// GENERIC-NOT: "-target-feature" "+atomics"
72+
// BLEEDING-EDGE-NOT: "-target-feature" "-atomics"
73+
74+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mtail-call 2>&1 | FileCheck %s -check-prefix=TAIL-CALL
75+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mno-tail-call 2>&1 | FileCheck %s -check-prefix=NO-TAIL-CALL
76+
77+
// TAIL-CALL: "-target-feature" "+tail-call"
78+
// NO-TAIL-CALL: "-target-feature" "-tail-call"
79+
// DEFAULT-NOT: "-target-feature" "-tail-call"
80+
// MVP-NOT: "-target-feature" "+tail-call"
81+
// GENERIC-NOT: "-target-feature" "+tail-call"
82+
// BLEEDING-EDGE-NOT: "-target-feature" "-tail-call"
83+
84+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mreference-types 2>&1 | FileCheck %s -check-prefix=REFERENCE-TYPES
85+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mno-reference-types 2>&1 | FileCheck %s -check-prefix=NO-REFERENCE-TYPES
86+
87+
// REFERENCE-TYPES: "-target-feature" "+reference-types"
88+
// NO-REFERENCE-TYPES: "-target-feature" "-reference-types"
89+
// DEFAULT-NOT: "-target-feature" "-reference-types"
90+
// MVP-NOT: "-target-feature" "+reference-types"
91+
// GENERIC-NOT: "-target-feature" "+reference-types"
92+
// BLEEDING-EDGE-NOT: "-target-feature" "-reference-types"
93+
94+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -msimd128 2>&1 | FileCheck %s -check-prefix=SIMD128
95+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mno-simd128 2>&1 | FileCheck %s -check-prefix=NO-SIMD128
96+
97+
// SIMD128: "-target-feature" "+simd128"
98+
// NO-SIMD128: "-target-feature" "-simd128"
99+
// DEFAULT-NOT: "-target-feature" "-simd128"
100+
// MVP-NOT: "-target-feature" "+simd128"
101+
// GENERIC-NOT: "-target-feature" "+simd128"
102+
// BLEEDING-EDGE-NOT: "-target-feature" "+simd128"
103+
104+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mrelaxed-simd 2>&1 | FileCheck %s -check-prefix=RELAXED-SIMD
105+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mno-relaxed-simd 2>&1 | FileCheck %s -check-prefix=NO-RELAXED-SIMD
106+
107+
// RELAXED-SIMD: "-target-feature" "+relaxed-simd"
108+
// NO-RELAXED-SIMD: "-target-feature" "-relaxed-simd"
109+
// DEFAULT-NOT: "-target-feature" "-relaxed-simd"
110+
// MVP-NOT: "-target-feature" "+relaxed-simd"
111+
// GENERIC-NOT: "-target-feature" "+relaxed-simd"
112+
// BLEEDING-EDGE-NOT: "-target-feature" "+relaxed-simd"
113+
114+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mexception-handling 2>&1 | FileCheck %s -check-prefix=EXCEPTION-HANDLING
115+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mno-exception-handling 2>&1 | FileCheck %s -check-prefix=NO-EXCEPTION-HANDLING
116+
117+
// EXCEPTION-HANDLING: "-target-feature" "+exception-handling"
118+
// NO-EXCEPTION-HANDLING: "-target-feature" "-exception-handling"
119+
// DEFAULT-NOT: "-target-feature" "-exception-handling"
120+
// MVP-NOT: "-target-feature" "+exception-handling"
121+
// GENERIC-NOT: "-target-feature" "+exception-handling"
122+
// BLEEDING-EDGE-NOT: "-target-feature" "+exception-handling"
123+
124+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mextended-const 2>&1 | FileCheck %s -check-prefix=EXTENDED-CONST
125+
// RUN: %clang --target=wasm32-unknown-unknown -### %s -mno-extended-const 2>&1 | FileCheck %s -check-prefix=NO-EXTENDED-CONST
126+
127+
// EXTENDED-CONST: "-target-feature" "+extended-const"
128+
// NO-EXTENDED-CONST: "-target-feature" "-extended-const"
129+
// DEFAULT-NOT: "-target-feature" "-extended-const"
130+
// MVP-NOT: "-target-feature" "+extended-const"
131+
// GENERIC-NOT: "-target-feature" "+extended-const"
132+
// BLEEDING-EDGE-NOT: "-target-feature" "+extended-const"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
// MVP-NOT:#define __wasm_reference_types__
145145
// MVP-NOT:#define __wasm_extended_const__
146146
// MVP-NOT:#define __wasm_multimemory__
147+
// MVP-NOT:#define __wasm_relaxed_simd__
147148

148149
// RUN: %clang -E -dM %s -o - 2>&1 \
149150
// RUN: -target wasm32-unknown-unknown -mcpu=bleeding-edge \
@@ -160,11 +161,11 @@
160161
// BLEEDING-EDGE-DAG:#define __wasm_mutable_globals__ 1{{$}}
161162
// BLEEDING-EDGE-DAG:#define __wasm_tail_call__ 1{{$}}
162163
// BLEEDING-EDGE-DAG:#define __wasm_multimemory__ 1{{$}}
163-
// BLEEDING-EDGE-NOT:#define __wasm_unimplemented_simd128__ 1{{$}}
164164
// BLEEDING-EDGE-NOT:#define __wasm_exception_handling__ 1{{$}}
165165
// BLEEDING-EDGE-NOT:#define __wasm_multivalue__ 1{{$}}
166166
// BLEEDING-EDGE-NOT:#define __wasm_reference_types__ 1{{$}}
167167
// BLEEDING-EDGE-NOT:#define __wasm_extended_const__ 1{{$}}
168+
// BLEEDING-EDGE-NOT:#define __wasm_relaxed_simd__ 1{{$}}
168169

169170
// RUN: %clang -E -dM %s -o - 2>&1 \
170171
// RUN: -target wasm32-unknown-unknown -mcpu=bleeding-edge -mno-simd128 \

0 commit comments

Comments
 (0)