aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/format/c23-dfp-printf-1.c
blob: 56707c4b07664984f2cc410eb5fac96980d75a31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* Test for printf formats: acceptance of DFP formats in pedantic mode.  */
/* { dg-do compile } */
/* { dg-require-effective-target dfp } */
/* { dg-options "-std=c23 -pedantic -Wformat" } */

#include "format.h"

void
foo (_Decimal32 d32, _Decimal64 d64, _Decimal128 d128)
{
  printf ("%Ha", d32);
  printf ("%HA", d32);
  printf ("%He", d32);
  printf ("%HE", d32);
  printf ("%Hf", d32);
  printf ("%HF", d32);
  printf ("%Hg", d32);
  printf ("%HG", d32);
  printf ("%Da", d64);
  printf ("%DA", d64);
  printf ("%De", d64);
  printf ("%DE", d64);
  printf ("%Df", d64);
  printf ("%DF", d64);
  printf ("%Dg", d64);
  printf ("%DG", d64);
  printf ("%DDa", d128);
  printf ("%DDA", d128);
  printf ("%DDe", d128);
  printf ("%DDE", d128);
  printf ("%DDf", d128);
  printf ("%DDF", d128);
  printf ("%DDg", d128);
  printf ("%DDG", d128);
}