view gcc/testsuite/gcc.dg/torture/pr71522.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do run } */

#if __SIZEOF_LONG_DOUBLE__ == 16
#define STR "AAAAAAAAAAAAAAA"
#elif __SIZEOF_LONG_DOUBLE__ == 12
#define STR "AAAAAAAAAAA"
#elif __SIZEOF_LONG_DOUBLE__ == 8
#define STR "AAAAAAA"
#elif __SIZEOF_LONG_DOUBLE__ == 4
#define STR "AAA"
#else
#define STR "A"
#endif

int main()
{
  long double d;
  char s[sizeof d];

  __builtin_memcpy(&d, STR, sizeof d);
  __builtin_memcpy(&s, &d, sizeof s);

  if (__builtin_strncmp (s, STR, sizeof s) != 0)
    __builtin_abort ();

  return 0;
}