blob: 3c743142a3e385cccb80c8a445f6783308e76cc8 [file] [log] [blame]
Dan Gohmanc2853072015-09-03 22:51:53 +00001// 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{{$}}
Thomas Livelyf3b4f992019-02-28 18:39:08 +00009
Dan Gohmanc2853072015-09-03 22:51:53 +000010// RUN: %clang -E -dM %s -o - 2>&1 \
Zhi An Ng15521792021-09-22 14:52:50 -070011// 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
16//
17// RELAXED-SIMD:#define __wasm_relaxed_simd__ 1{{$}}
18
19// RUN: %clang -E -dM %s -o - 2>&1 \
Thomas Lively88058d42019-01-31 21:02:19 +000020// 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
25//
26// NONTRAPPING-FPTOINT:#define __wasm_nontrapping_fptoint__ 1{{$}}
Thomas Livelyf3b4f992019-02-28 18:39:08 +000027
Thomas Lively88058d42019-01-31 21:02:19 +000028// 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
34//
35// SIGN-EXT:#define __wasm_sign_ext__ 1{{$}}
Thomas Livelyf3b4f992019-02-28 18:39:08 +000036
Thomas Lively88058d42019-01-31 21:02:19 +000037// 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
43//
44// EXCEPTION-HANDLING:#define __wasm_exception_handling__ 1{{$}}
Thomas Livelyf3b4f992019-02-28 18:39:08 +000045
Thomas Lively88058d42019-01-31 21:02:19 +000046// 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
52//
53// BULK-MEMORY:#define __wasm_bulk_memory__ 1{{$}}
Thomas Livelyf3b4f992019-02-28 18:39:08 +000054
Thomas Lively88058d42019-01-31 21:02:19 +000055// RUN: %clang -E -dM %s -o - 2>&1 \
Thomas Livelyf3b4f992019-02-28 18:39:08 +000056// RUN: -target wasm32-unknown-unknown -matomics \
Heejin Ahnbab85972019-02-06 01:41:26 +000057// RUN: | FileCheck %s -check-prefix=ATOMICS
58// RUN: %clang -E -dM %s -o - 2>&1 \
Thomas Livelyf3b4f992019-02-28 18:39:08 +000059// RUN: -target wasm64-unknown-unknown -matomics \
Heejin Ahnbab85972019-02-06 01:41:26 +000060// RUN: | FileCheck %s -check-prefix=ATOMICS
61//
Thomas Lively70f5fc12019-03-02 00:18:09 +000062// ATOMICS:#define __wasm_atomics__ 1{{$}}
Thomas Livelyf3b4f992019-02-28 18:39:08 +000063
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
Heejin Ahnbab85972019-02-06 01:41:26 +000070//
Thomas Lively70f5fc12019-03-02 00:18:09 +000071// PTHREAD:#define __wasm_atomics__ 1{{$}}
Thomas Livelyf3b4f992019-02-28 18:39:08 +000072
Heejin Ahnbab85972019-02-06 01:41:26 +000073// RUN: %clang -E -dM %s -o - 2>&1 \
Thomas Lively5f0c4c62019-03-29 22:00:18 +000074// 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
79//
80// MUTABLE-GLOBALS:#define __wasm_mutable_globals__ 1{{$}}
81
82// RUN: %clang -E -dM %s -o - 2>&1 \
Thomas Livelyeafe8ef2019-05-23 17:26:47 +000083// 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
88//
89// MULTIVALUE:#define __wasm_multivalue__ 1{{$}}
90
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
97//
98// TAIL-CALL:#define __wasm_tail_call__ 1{{$}}
Heejin Ahn764f4082020-01-23 19:22:51 -080099//
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
106//
107// REFERENCE-TYPES:#define __wasm_reference_types__ 1{{$}}
Thomas Livelyeafe8ef2019-05-23 17:26:47 +0000108
109// RUN: %clang -E -dM %s -o - 2>&1 \
Dan Gohmanc2853072015-09-03 22:51:53 +0000110// RUN: -target wasm32-unknown-unknown -mcpu=mvp \
111// RUN: | FileCheck %s -check-prefix=MVP
112// RUN: %clang -E -dM %s -o - 2>&1 \
113// RUN: -target wasm64-unknown-unknown -mcpu=mvp \
114// RUN: | FileCheck %s -check-prefix=MVP
115//
116// MVP-NOT:#define __wasm_simd128__
Thomas Lively88058d42019-01-31 21:02:19 +0000117// MVP-NOT:#define __wasm_nontrapping_fptoint__
118// MVP-NOT:#define __wasm_sign_ext__
119// MVP-NOT:#define __wasm_exception_handling__
120// MVP-NOT:#define __wasm_bulk_memory__
Heejin Ahnbab85972019-02-06 01:41:26 +0000121// MVP-NOT:#define __wasm_atomics__
Thomas Lively5f0c4c62019-03-29 22:00:18 +0000122// MVP-NOT:#define __wasm_mutable_globals__
Thomas Livelyeafe8ef2019-05-23 17:26:47 +0000123// MVP-NOT:#define __wasm_multivalue__
124// MVP-NOT:#define __wasm_tail_call__
Heejin Ahn764f4082020-01-23 19:22:51 -0800125// MVP-NOT:#define __wasm_reference_types__
Thomas Livelyf3b4f992019-02-28 18:39:08 +0000126
Dan Gohmanc2853072015-09-03 22:51:53 +0000127// RUN: %clang -E -dM %s -o - 2>&1 \
128// RUN: -target wasm32-unknown-unknown -mcpu=bleeding-edge \
Thomas Lively88058d42019-01-31 21:02:19 +0000129// RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE
Dan Gohmanc2853072015-09-03 22:51:53 +0000130// RUN: %clang -E -dM %s -o - 2>&1 \
131// RUN: -target wasm64-unknown-unknown -mcpu=bleeding-edge \
Thomas Lively88058d42019-01-31 21:02:19 +0000132// RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE
Dan Gohmanc2853072015-09-03 22:51:53 +0000133//
Heejin Ahnbab85972019-02-06 01:41:26 +0000134// BLEEDING-EDGE-DAG:#define __wasm_nontrapping_fptoint__ 1{{$}}
135// BLEEDING-EDGE-DAG:#define __wasm_sign_ext__ 1{{$}}
Heejin Ahn65eb1132020-01-23 19:32:32 -0800136// BLEEDING-EDGE-DAG:#define __wasm_bulk_memory__ 1{{$}}
Heejin Ahnbab85972019-02-06 01:41:26 +0000137// BLEEDING-EDGE-DAG:#define __wasm_simd128__ 1{{$}}
138// BLEEDING-EDGE-DAG:#define __wasm_atomics__ 1{{$}}
Thomas Lively5f0c4c62019-03-29 22:00:18 +0000139// BLEEDING-EDGE-DAG:#define __wasm_mutable_globals__ 1{{$}}
Heejin Ahn65eb1132020-01-23 19:32:32 -0800140// BLEEDING-EDGE-DAG:#define __wasm_tail_call__ 1{{$}}
Thomas Lively88058d42019-01-31 21:02:19 +0000141// BLEEDING-EDGE-NOT:#define __wasm_unimplemented_simd128__ 1{{$}}
Heejin Ahn65eb1132020-01-23 19:32:32 -0800142// BLEEDING-EDGE-NOT:#define __wasm_exception_handling__ 1{{$}}
Thomas Livelyeafe8ef2019-05-23 17:26:47 +0000143// BLEEDING-EDGE-NOT:#define __wasm_multivalue__ 1{{$}}
Heejin Ahn764f4082020-01-23 19:22:51 -0800144// BLEEDING-EDGE-NOT:#define __wasm_reference_types__ 1{{$}}
Thomas Livelyf3b4f992019-02-28 18:39:08 +0000145
Dan Gohmanc2853072015-09-03 22:51:53 +0000146// RUN: %clang -E -dM %s -o - 2>&1 \
147// RUN: -target wasm32-unknown-unknown -mcpu=bleeding-edge -mno-simd128 \
Thomas Lively88058d42019-01-31 21:02:19 +0000148// RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE-NO-SIMD128
Dan Gohmanc2853072015-09-03 22:51:53 +0000149// RUN: %clang -E -dM %s -o - 2>&1 \
150// RUN: -target wasm64-unknown-unknown -mcpu=bleeding-edge -mno-simd128 \
Thomas Lively88058d42019-01-31 21:02:19 +0000151// RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE-NO-SIMD128
Dan Gohmanc2853072015-09-03 22:51:53 +0000152//
Thomas Lively88058d42019-01-31 21:02:19 +0000153// BLEEDING-EDGE-NO-SIMD128-NOT:#define __wasm_simd128__