| 1 |
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -ffreestanding -fsyntax-only -verify %s |
| 2 |
|
| 3 |
#include <arm_neon.h> |
| 4 |
// REQUIRES: aarch64-registered-target |
| 5 |
|
| 6 |
|
| 7 |
void test_conversions_f32(float32_t arg_f32, float32x2_t arg_f32x2, float32x4_t arg_f32x4) { |
| 8 |
vcvt_n_s32_f32(arg_f32x2, 1); |
| 9 |
vcvt_n_s32_f32(arg_f32x2, 32); |
| 10 |
vcvt_n_s32_f32(arg_f32x2, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 11 |
vcvt_n_s32_f32(arg_f32x2, 33); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 12 |
|
| 13 |
vcvtq_n_s32_f32(arg_f32x4, 1); |
| 14 |
vcvtq_n_s32_f32(arg_f32x4, 32); |
| 15 |
vcvtq_n_s32_f32(arg_f32x4, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 16 |
vcvtq_n_s32_f32(arg_f32x4, 33); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 17 |
|
| 18 |
vcvt_n_u32_f32(arg_f32x2, 1); |
| 19 |
vcvt_n_u32_f32(arg_f32x2, 32); |
| 20 |
vcvt_n_u32_f32(arg_f32x2, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 21 |
vcvt_n_u32_f32(arg_f32x2, 33); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 22 |
|
| 23 |
vcvtq_n_u32_f32(arg_f32x4, 1); |
| 24 |
vcvtq_n_u32_f32(arg_f32x4, 32); |
| 25 |
vcvtq_n_u32_f32(arg_f32x4, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 26 |
vcvtq_n_u32_f32(arg_f32x4, 33); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 27 |
|
| 28 |
vcvts_n_s32_f32(arg_f32, 1); |
| 29 |
vcvts_n_s32_f32(arg_f32, 32); |
| 30 |
vcvts_n_s32_f32(arg_f32, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 31 |
vcvts_n_s32_f32(arg_f32, 33); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 32 |
|
| 33 |
vcvts_n_u32_f32(arg_f32, 1); |
| 34 |
vcvts_n_u32_f32(arg_f32, 32); |
| 35 |
vcvts_n_u32_f32(arg_f32, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 36 |
vcvts_n_u32_f32(arg_f32, 33); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 37 |
|
| 38 |
} |
| 39 |
|
| 40 |
void test_conversions_f64(float64x1_t arg_f64x1, float64x2_t arg_f64x2, float64_t arg_f64) { |
| 41 |
vcvt_n_s64_f64(arg_f64x1, 1); |
| 42 |
vcvt_n_s64_f64(arg_f64x1, 64); |
| 43 |
vcvt_n_s64_f64(arg_f64x1, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 44 |
vcvt_n_s64_f64(arg_f64x1, 65); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 45 |
|
| 46 |
vcvtq_n_s64_f64(arg_f64x2, 1); |
| 47 |
vcvtq_n_s64_f64(arg_f64x2, 64); |
| 48 |
vcvtq_n_s64_f64(arg_f64x2, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 49 |
vcvtq_n_s64_f64(arg_f64x2, 65); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 50 |
|
| 51 |
vcvt_n_u64_f64(arg_f64x1, 1); |
| 52 |
vcvt_n_u64_f64(arg_f64x1, 64); |
| 53 |
vcvt_n_u64_f64(arg_f64x1, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 54 |
vcvt_n_u64_f64(arg_f64x1, 65); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 55 |
|
| 56 |
vcvtq_n_u64_f64(arg_f64x2, 1); |
| 57 |
vcvtq_n_u64_f64(arg_f64x2, 64); |
| 58 |
vcvtq_n_u64_f64(arg_f64x2, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 59 |
vcvtq_n_u64_f64(arg_f64x2, 65); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 60 |
|
| 61 |
vcvtd_n_s64_f64(arg_f64, 1); |
| 62 |
vcvtd_n_s64_f64(arg_f64, 64); |
| 63 |
vcvtd_n_s64_f64(arg_f64, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 64 |
vcvtd_n_s64_f64(arg_f64, 65); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 65 |
|
| 66 |
vcvtd_n_u64_f64(arg_f64, 1); |
| 67 |
vcvtd_n_u64_f64(arg_f64, 64); |
| 68 |
vcvtd_n_u64_f64(arg_f64, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 69 |
vcvtd_n_u64_f64(arg_f64, 65); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 70 |
|
| 71 |
} |
| 72 |
|
| 73 |
void test_conversions_s32(int32_t arg_i32, int32x2_t arg_i32x2, int32x4_t arg_i32x4) { |
| 74 |
vcvt_n_f32_s32(arg_i32x2, 1); |
| 75 |
vcvt_n_f32_s32(arg_i32x2, 32); |
| 76 |
vcvt_n_f32_s32(arg_i32x2, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 77 |
vcvt_n_f32_s32(arg_i32x2, 33); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 78 |
|
| 79 |
vcvtq_n_f32_s32(arg_i32x4, 1); |
| 80 |
vcvtq_n_f32_s32(arg_i32x4, 32); |
| 81 |
vcvtq_n_f32_s32(arg_i32x4, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 82 |
vcvtq_n_f32_s32(arg_i32x4, 33); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 83 |
|
| 84 |
vcvts_n_f32_s32(arg_i32, 1); |
| 85 |
vcvts_n_f32_s32(arg_i32, 32); |
| 86 |
vcvts_n_f32_s32(arg_i32, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 87 |
vcvts_n_f32_s32(arg_i32, 33); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 88 |
|
| 89 |
} |
| 90 |
|
| 91 |
void test_conversions_u32(uint32x4_t arg_u32x4, uint32x2_t arg_u32x2, uint32_t arg_u32) { |
| 92 |
vcvt_n_f32_u32(arg_u32x2, 1); |
| 93 |
vcvt_n_f32_u32(arg_u32x2, 32); |
| 94 |
vcvt_n_f32_u32(arg_u32x2, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 95 |
vcvt_n_f32_u32(arg_u32x2, 33); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 96 |
|
| 97 |
vcvtq_n_f32_u32(arg_u32x4, 1); |
| 98 |
vcvtq_n_f32_u32(arg_u32x4, 32); |
| 99 |
vcvtq_n_f32_u32(arg_u32x4, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 100 |
vcvtq_n_f32_u32(arg_u32x4, 33); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 101 |
|
| 102 |
vcvts_n_f32_u32(arg_u32, 1); |
| 103 |
vcvts_n_f32_u32(arg_u32, 32); |
| 104 |
vcvts_n_f32_u32(arg_u32, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 105 |
vcvts_n_f32_u32(arg_u32, 33); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 106 |
|
| 107 |
} |
| 108 |
|
| 109 |
void test_conversions_s64(int64x2_t arg_i64x2, int64x1_t arg_i64x1, int64_t arg_i64) { |
| 110 |
vcvt_n_f64_s64(arg_i64x1, 1); |
| 111 |
vcvt_n_f64_s64(arg_i64x1, 64); |
| 112 |
vcvt_n_f64_s64(arg_i64x1, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 113 |
vcvt_n_f64_s64(arg_i64x1, 65); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 114 |
|
| 115 |
vcvtq_n_f64_s64(arg_i64x2, 1); |
| 116 |
vcvtq_n_f64_s64(arg_i64x2, 64); |
| 117 |
vcvtq_n_f64_s64(arg_i64x2, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 118 |
vcvtq_n_f64_s64(arg_i64x2, 65); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 119 |
|
| 120 |
vcvtd_n_f64_s64(arg_i64, 1); |
| 121 |
vcvtd_n_f64_s64(arg_i64, 64); |
| 122 |
vcvtd_n_f64_s64(arg_i64, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 123 |
vcvtd_n_f64_s64(arg_i64, 65); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 124 |
|
| 125 |
} |
| 126 |
|
| 127 |
void test_conversions_u64(uint64x2_t arg_u64x2, uint64_t arg_u64, uint64x1_t arg_u64x1) { |
| 128 |
vcvt_n_f64_u64(arg_u64x1, 1); |
| 129 |
vcvt_n_f64_u64(arg_u64x1, 64); |
| 130 |
vcvt_n_f64_u64(arg_u64x1, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 131 |
vcvt_n_f64_u64(arg_u64x1, 65); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 132 |
|
| 133 |
vcvtq_n_f64_u64(arg_u64x2, 1); |
| 134 |
vcvtq_n_f64_u64(arg_u64x2, 64); |
| 135 |
vcvtq_n_f64_u64(arg_u64x2, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 136 |
vcvtq_n_f64_u64(arg_u64x2, 65); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 137 |
|
| 138 |
vcvtd_n_f64_u64(arg_u64, 1); |
| 139 |
vcvtd_n_f64_u64(arg_u64, 64); |
| 140 |
vcvtd_n_f64_u64(arg_u64, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 141 |
vcvtd_n_f64_u64(arg_u64, 65); // expected-error-re {{argument value {{.*}} is outside the valid range}} |
| 142 |
|
| 143 |
} |
| 144 |
|