]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Update Wconversion testcase check type.
authorjiawei <jiawei@iscas.ac.cn>
Thu, 5 May 2022 10:33:20 +0000 (18:33 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 12 May 2022 04:31:01 +0000 (21:31 -0700)
Some compiler target like arm-linux\riscv\power\s390x\xtensa-gcc handle
char as unsigned char, then there are no warnings occur and got FAIL cases.
Just change the type char into explicit signed char to keep the feature
consistency.

gcc/testsuite/ChangeLog:

* c-c++-common/Wconversion-1.c: Update type.

gcc/testsuite/c-c++-common/Wconversion-1.c

index ed65918c70f65a63f021023f39d331da94e2e6ce..81f9498d07c658bca6902dd256a997f288a4343c 100644 (file)
@@ -10,5 +10,5 @@ void g()
   signed char sc = 300; /* { dg-warning "conversion from .int. to .signed char. changes value from .300. to .44." } */
   unsigned char uc = 300; /* { dg-warning "conversion from .int. to .unsigned char. changes value from .300. to .44." } */
   unsigned char uc2 = 300u; /* { dg-warning "conversion from .unsigned int. to .unsigned char. changes value from .300. to .44." } */
-  char c2 = (double)1.0 + 200; /* { dg-warning "overflow in conversion from .double. to .char. changes value from .2.01e\\+2. to .127." } */
+  signed char c2 = (double)1.0 + 200; /* { dg-warning "overflow in conversion from .double. to .signed char. changes value from .2.01e\\+2. to .127." } */
 }