1*207e5cccSFangrui Song // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -target-feature +sha3 -target-feature +sm4 -verify %s 2*207e5cccSFangrui Song 3*207e5cccSFangrui Song // REQUIRES: aarch64-registered-target || arm-registered-target 4*207e5cccSFangrui Song 5*207e5cccSFangrui Song #include <arm_neon.h> 6*207e5cccSFangrui Song 7*207e5cccSFangrui Song void test_range_check_vsm3tt1a(uint32x4_t a, uint32x4_t b, uint32x4_t c) { 8*207e5cccSFangrui Song vsm3tt1aq_u32(a, b, c, 4); // expected-error {{argument value 4 is outside the valid range [0, 3]}} 9*207e5cccSFangrui Song vsm3tt1aq_u32(a, b, c, -1); // expected-error {{argument value -1 is outside the valid range [0, 3]}} 10*207e5cccSFangrui Song vsm3tt1aq_u32(a, b, c, 3); 11*207e5cccSFangrui Song vsm3tt1aq_u32(a, b, c, 0); 12*207e5cccSFangrui Song } 13*207e5cccSFangrui Song 14*207e5cccSFangrui Song void test_range_check_vsm3tt1b(uint32x4_t a, uint32x4_t b, uint32x4_t c) { 15*207e5cccSFangrui Song vsm3tt1bq_u32(a, b, c, 4);// expected-error {{argument value 4 is outside the valid range [0, 3]}} 16*207e5cccSFangrui Song vsm3tt1bq_u32(a, b, c, -1); // expected-error {{argument value -1 is outside the valid range [0, 3]}} 17*207e5cccSFangrui Song vsm3tt1bq_u32(a, b, c, 3); 18*207e5cccSFangrui Song vsm3tt1bq_u32(a, b, c, 0); 19*207e5cccSFangrui Song } 20*207e5cccSFangrui Song 21*207e5cccSFangrui Song void test_range_check_vsm3tt2a(uint32x4_t a, uint32x4_t b, uint32x4_t c) { 22*207e5cccSFangrui Song vsm3tt2aq_u32(a, b, c, 4);// expected-error {{argument value 4 is outside the valid range [0, 3]}} 23*207e5cccSFangrui Song vsm3tt2aq_u32(a, b, c, -1); // expected-error {{argument value -1 is outside the valid range [0, 3]}} 24*207e5cccSFangrui Song vsm3tt2aq_u32(a, b, c, 3); 25*207e5cccSFangrui Song vsm3tt2aq_u32(a, b, c, 0); 26*207e5cccSFangrui Song } 27*207e5cccSFangrui Song 28*207e5cccSFangrui Song void test_range_check_vsm3tt2b(uint32x4_t a, uint32x4_t b, uint32x4_t c) { 29*207e5cccSFangrui Song vsm3tt2bq_u32(a, b, c, 4);// expected-error {{argument value 4 is outside the valid range [0, 3]}} 30*207e5cccSFangrui Song vsm3tt2bq_u32(a, b, c, -1); // expected-error {{argument value -1 is outside the valid range [0, 3]}} 31*207e5cccSFangrui Song vsm3tt2bq_u32(a, b, c, 3); 32*207e5cccSFangrui Song vsm3tt2bq_u32(a, b, c, 0); 33*207e5cccSFangrui Song } 34*207e5cccSFangrui Song 35*207e5cccSFangrui Song void test_range_check_xar(uint64x2_t a, uint64x2_t b) { 36*207e5cccSFangrui Song vxarq_u64(a, b, -1); // expected-error {{argument value -1 is outside the valid range [0, 63]}} 37*207e5cccSFangrui Song vxarq_u64(a, b, 64); // expected-error {{argument value 64 is outside the valid range [0, 63]}} 38*207e5cccSFangrui Song vxarq_u64(a, b, 0); 39*207e5cccSFangrui Song vxarq_u64(a, b, 63); 40*207e5cccSFangrui Song } 41*207e5cccSFangrui Song 42