blob: 8c10cd7808ac4be806844e6052371e0a61483e9f [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{{$}}
9//
10// RUN: %clang -E -dM %s -o - 2>&1 \
Thomas Livelyb7b9fdc2019-01-10 23:49:00 +000011// RUN: -target wasm32-unknown-unknown -munimplemented-simd128 \
12// RUN: | FileCheck %s -check-prefix=SIMD128-UNIMPLEMENTED
13// RUN: %clang -E -dM %s -o - 2>&1 \
14// RUN: -target wasm64-unknown-unknown -munimplemented-simd128 \
15// RUN: | FileCheck %s -check-prefix=SIMD128-UNIMPLEMENTED
16//
17// SIMD128-UNIMPLEMENTED:#define __wasm_unimplemented_simd128__ 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{{$}}
27//
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
34//
35// SIGN-EXT:#define __wasm_sign_ext__ 1{{$}}
36//
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
43//
44// EXCEPTION-HANDLING:#define __wasm_exception_handling__ 1{{$}}
45//
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
52//
53// BULK-MEMORY:#define __wasm_bulk_memory__ 1{{$}}
54//
55// RUN: %clang -E -dM %s -o - 2>&1 \
Dan Gohmanc2853072015-09-03 22:51:53 +000056// RUN: -target wasm32-unknown-unknown -mcpu=mvp \
57// RUN: | FileCheck %s -check-prefix=MVP
58// RUN: %clang -E -dM %s -o - 2>&1 \
59// RUN: -target wasm64-unknown-unknown -mcpu=mvp \
60// RUN: | FileCheck %s -check-prefix=MVP
61//
62// MVP-NOT:#define __wasm_simd128__
Thomas Lively88058d42019-01-31 21:02:19 +000063// MVP-NOT:#define __wasm_unimplemented_simd128__
64// MVP-NOT:#define __wasm_nontrapping_fptoint__
65// MVP-NOT:#define __wasm_sign_ext__
66// MVP-NOT:#define __wasm_exception_handling__
67// MVP-NOT:#define __wasm_bulk_memory__
Dan Gohmanc2853072015-09-03 22:51:53 +000068//
69// RUN: %clang -E -dM %s -o - 2>&1 \
70// RUN: -target wasm32-unknown-unknown -mcpu=bleeding-edge \
Thomas Lively88058d42019-01-31 21:02:19 +000071// RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE
Dan Gohmanc2853072015-09-03 22:51:53 +000072// RUN: %clang -E -dM %s -o - 2>&1 \
73// RUN: -target wasm64-unknown-unknown -mcpu=bleeding-edge \
Thomas Lively88058d42019-01-31 21:02:19 +000074// RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE
Dan Gohmanc2853072015-09-03 22:51:53 +000075//
Thomas Lively88058d42019-01-31 21:02:19 +000076// BLEEDING-EDGE:#define __wasm_nontrapping_fptoint__ 1{{$}}
77// BLEEDING-EDGE:#define __wasm_sign_ext__ 1{{$}}
78// BLEEDING-EDGE:#define __wasm_simd128__ 1{{$}}
79// BLEEDING-EDGE-NOT:#define __wasm_unimplemented_simd128__ 1{{$}}
Dan Gohmanc2853072015-09-03 22:51:53 +000080//
81// RUN: %clang -E -dM %s -o - 2>&1 \
82// RUN: -target wasm32-unknown-unknown -mcpu=bleeding-edge -mno-simd128 \
Thomas Lively88058d42019-01-31 21:02:19 +000083// RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE-NO-SIMD128
Dan Gohmanc2853072015-09-03 22:51:53 +000084// RUN: %clang -E -dM %s -o - 2>&1 \
85// RUN: -target wasm64-unknown-unknown -mcpu=bleeding-edge -mno-simd128 \
Thomas Lively88058d42019-01-31 21:02:19 +000086// RUN: | FileCheck %s -check-prefix=BLEEDING-EDGE-NO-SIMD128
Dan Gohmanc2853072015-09-03 22:51:53 +000087//
Thomas Lively88058d42019-01-31 21:02:19 +000088// BLEEDING-EDGE-NO-SIMD128-NOT:#define __wasm_simd128__