(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
builtins-28.c
       1  /* Test that creal and cimag built-in functions do not return lvalues.  */
       2  /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
       3  /* { dg-do compile } */
       4  /* { dg-options "" } */
       5  
       6  extern float crealf (float _Complex);
       7  extern double creal (double _Complex);
       8  extern long double creall (long double _Complex);
       9  
      10  extern float cimagf (float _Complex);
      11  extern double cimag (double _Complex);
      12  extern long double cimagl (long double _Complex);
      13  
      14  float _Complex fc;
      15  double _Complex dc;
      16  long double _Complex ldc;
      17  
      18  void
      19  foo (void)
      20  {
      21    crealf (fc) = 0; /* { dg-error "lvalue" "crealf not lvalue" } */
      22    cimagf (fc) = 0; /* { dg-error "lvalue" "cimagf not lvalue" } */
      23    creal (dc) = 0; /* { dg-error "lvalue" "creal not lvalue" } */
      24    cimag (dc) = 0; /* { dg-error "lvalue" "cimag not lvalue" } */
      25    creall (ldc) = 0; /* { dg-error "lvalue" "creall not lvalue" } */
      26    cimagl (ldc) = 0; /* { dg-error "lvalue" "cimagl not lvalue" } */
      27  }