[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Sema / aarch64-sve-explicit-casts-fixed-size.c
blob3b5f48db6b3fbe6438fdb27b4582c36c00f21a13
1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -mvscale-min=1 -mvscale-max=1 -flax-vector-conversions=none -fallow-half-arguments-and-returns -ffreestanding -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -mvscale-min=2 -mvscale-max=2 -flax-vector-conversions=none -fallow-half-arguments-and-returns -ffreestanding -fsyntax-only -verify %s
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -mvscale-min=4 -mvscale-max=4 -flax-vector-conversions=none -fallow-half-arguments-and-returns -ffreestanding -fsyntax-only -verify %s
4 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -mvscale-min=8 -mvscale-max=8 -flax-vector-conversions=none -fallow-half-arguments-and-returns -ffreestanding -fsyntax-only -verify %s
5 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -mvscale-min=16 -mvscale-max=16 -flax-vector-conversions=none -fallow-half-arguments-and-returns -ffreestanding -fsyntax-only -verify %s
7 // expected-no-diagnostics
9 // REQUIRES: aarch64-registered-target || arm-registered-target
11 #include <arm_sve.h>
13 #define N __ARM_FEATURE_SVE_BITS
14 #define FIXED_ATTR __attribute__((arm_sve_vector_bits(N)))
16 typedef svfloat32_t fixed_float32_t FIXED_ATTR;
17 typedef svfloat64_t fixed_float64_t FIXED_ATTR;
18 typedef svint32_t fixed_int32_t FIXED_ATTR;
19 typedef svint64_t fixed_int64_t FIXED_ATTR;
21 // SVE VLSTs can be cast to SVE VLATs, regardless of lane size.
22 // NOTE: the list below is NOT exhaustive for all SVE types.
24 #define CAST(from, to) \
25 void from##_to_##to(from a, to b) { \
26 b = (to) a; \
29 #define TESTCASE(ty1, ty2) \
30 CAST(ty1, ty2) \
31 CAST(ty2, ty1)
33 TESTCASE(fixed_float32_t, svfloat32_t)
34 TESTCASE(fixed_float32_t, svfloat64_t)
35 TESTCASE(fixed_float32_t, svint32_t)
36 TESTCASE(fixed_float32_t, svint64_t)
38 TESTCASE(fixed_float64_t, svfloat32_t)
39 TESTCASE(fixed_float64_t, svfloat64_t)
40 TESTCASE(fixed_float64_t, svint32_t)
41 TESTCASE(fixed_float64_t, svint64_t)
43 TESTCASE(fixed_int32_t, svfloat32_t)
44 TESTCASE(fixed_int32_t, svfloat64_t)
45 TESTCASE(fixed_int32_t, svint32_t)
46 TESTCASE(fixed_int32_t, svint64_t)
48 TESTCASE(fixed_int64_t, svfloat32_t)
49 TESTCASE(fixed_int64_t, svfloat64_t)
50 TESTCASE(fixed_int64_t, svint32_t)
51 TESTCASE(fixed_int64_t, svint64_t)