xref: /llvm-project/clang/test/CodeGen/AArch64/neon-vuqadd-float-conversion-warning.c (revision 207e5ccceec8d3cc3f32723e78f2a142bc61b07d)
1*207e5cccSFangrui Song // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
2*207e5cccSFangrui Song // RUN:  -disable-O0-optnone -emit-llvm -o - %s 2>&1 | FileCheck %s
3*207e5cccSFangrui Song 
4*207e5cccSFangrui Song // REQUIRES: aarch64-registered-target || arm-registered-target
5*207e5cccSFangrui Song 
6*207e5cccSFangrui Song #include <arm_neon.h>
7*207e5cccSFangrui Song 
8*207e5cccSFangrui Song // Check float conversion is not accepted for unsigned int argument
9*207e5cccSFangrui Song int8_t test_vuqaddb_s8(){
10*207e5cccSFangrui Song   return vuqaddb_s8(1, -1.0f);
11*207e5cccSFangrui Song }
12*207e5cccSFangrui Song 
13*207e5cccSFangrui Song int16_t test_vuqaddh_s16() {
14*207e5cccSFangrui Song   return vuqaddh_s16(1, -1.0f);
15*207e5cccSFangrui Song }
16*207e5cccSFangrui Song 
17*207e5cccSFangrui Song int32_t test_vuqadds_s32() {
18*207e5cccSFangrui Song   return vuqadds_s32(1, -1.0f);
19*207e5cccSFangrui Song }
20*207e5cccSFangrui Song 
21*207e5cccSFangrui Song int64_t test_vuqaddd_s64() {
22*207e5cccSFangrui Song   return vuqaddd_s64(1, -1.0f);
23*207e5cccSFangrui Song }
24*207e5cccSFangrui Song // CHECK: warning: implicit conversion of out of range value from 'float' to 'uint8_t' (aka 'unsigned char') is undefined
25*207e5cccSFangrui Song // CHECK: warning: implicit conversion of out of range value from 'float' to 'uint16_t' (aka 'unsigned short') is undefined
26*207e5cccSFangrui Song // CHECK: warning: implicit conversion of out of range value from 'float' to 'uint32_t' (aka 'unsigned int') is undefined
27*207e5cccSFangrui Song // CHECK: warning: implicit conversion of out of range value from 'float' to 'uint64_t' (aka 'unsigned long') is undefined
28*207e5cccSFangrui Song 
29