Drop need for constant I in ctf test

Message ID or1qmou68k.fsf@lxoliva.fsfla.org
State Accepted
Headers
Series Drop need for constant I in ctf test |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Alexandre Oliva Feb. 17, 2023, 6:59 a.m. UTC
  Though I is supposed to be a constant expression, this is not the case
on vxworks, but this is not what this debug information format test is
testing for, so use real constants to initialize complex variables.

Regstrapped on x86_64-linux-gnu.
Tested on arm-vxworks7 (gcc-12) and arm-eabi (trunk).  Ok to install?

for  gcc/testsuite/ChangeLog

	* gcc.dg/debug/ctf/ctf-complex-1.c: Do not test whether I is
	usable in initializers.
---
 gcc/testsuite/gcc.dg/debug/ctf/ctf-complex-1.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Mike Stump Feb. 17, 2023, 7:56 p.m. UTC | #1
On Feb 16, 2023, at 10:59 PM, Alexandre Oliva <oliva@adacore.com> wrote:
> 
> Though I is supposed to be a constant expression, this is not the case
> on vxworks, but this is not what this debug information format test is
> testing for, so use real constants to initialize complex variables.
> 
> Regstrapped on x86_64-linux-gnu.
> Tested on arm-vxworks7 (gcc-12) and arm-eabi (trunk).  Ok to install?

Ok.
  

Patch

diff --git a/gcc/testsuite/gcc.dg/debug/ctf/ctf-complex-1.c b/gcc/testsuite/gcc.dg/debug/ctf/ctf-complex-1.c
index a36dd9b6b90a9..e6c3199f913d7 100644
--- a/gcc/testsuite/gcc.dg/debug/ctf/ctf-complex-1.c
+++ b/gcc/testsuite/gcc.dg/debug/ctf/ctf-complex-1.c
@@ -14,8 +14,8 @@ 
 
 #include <complex.h>
 
-double complex z1 = I * I;
+double complex z1 = -1;
 
-const long double complex z2 = I * I;
+const long double complex z2 = -1;
 
-float complex z4 = 1+2.11*I;
+float complex z4 = 1;