c++: normalizing ttp constraints [PR115656]
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / float128-longdouble-stdio.c
blob39e59d949f9f10586758d128faf5aa4efd3cf417
1 /* { dg-require-effective-target ppc_float128_hw } */
2 /* { dg-options "-mdejagnu-cpu=power9 -O2 -mlong-double-128 -Wno-psabi -mabi=ieeelongdouble" } */
4 /* Test if switching long double to IEEE 128-bit maps the printf and scanf
5 function names correctly. We leave off the \M in matching the calls, so
6 power10 will match using bl foo@notoc. */
8 #include <stdlib.h>
10 volatile long double x = 1.0L;
11 volatile long double y, z;
13 int
14 main (void)
16 char buffer[100];
18 /* { dg-final { scan-assembler {\mbl __sprintfieee128} } } */
19 __builtin_sprintf (buffer, "%Lg", x);
21 /* { dg-final { scan-assembler {\mbl __printfieee128} } } */
22 __builtin_printf ("x is %Lg [%s]\n", x, buffer);
24 /* { dg-final { scan-assembler {\mbl __isoc99_sscanfieee128} } } */
25 __builtin_sscanf (buffer, "%Lg", &y);
27 __builtin_printf ("Type 1.0: ");
29 /* { dg-final { scan-assembler {\mbl __isoc99_scanfieee128} } } */
30 __builtin_scanf ("%Lg", &z);
32 if (x != y || x != z)
33 abort ();
35 return 0;