1 /* { dg-do compile } */
2 /* { dg-require-effective-target arm_thumb2_ok } */
3 /* { dg-options "-march=armv7-a -mfloat-abi=hard -mfpu=neon -O2" } */
4 /* { dg-skip-if "need SIMD instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
5 /* { dg-skip-if "need SIMD instructions" { *-*-* } { "-mfpu=vfp*" } { "" } } */
6 /* { dg-skip-if "-mpure-code supports M-profile only" { *-*-* } { "-mpure-code" } } */
7 
8 #define BUF 100
9 long a[BUF];
10 
11 typedef unsigned int size_t;
12 typedef unsigned int wchar_t;
13 void *memset (void *s, int c, size_t n);
14 struct printf_info
15 {
16   int prec;
17   int width;
18   wchar_t spec;
19   unsigned int is_long_double:1;
20   unsigned int is_short:1;
21   unsigned int is_long:1;
22   unsigned int alt:1;
23   unsigned int space:1;
24   unsigned int left:1;
25   unsigned int showsign:1;
26   unsigned int group:1;
27   unsigned int extra:1;
28   unsigned int is_char:1;
29   unsigned int wide:1;
30   unsigned int i18n:1;
31   unsigned int __pad:4;
32   unsigned short int user;
33   wchar_t pad;
34 };
35 
36 void bar (int *alt, int *space, int *left, int *showsign,
37 	  int *group,
38 	  int *is_long_double,
39 	  int *is_short,
40 	  int *is_long,
41 	  int *width,
42 	  int *prec,
43 	  int *use_outdigits,
44 	  unsigned int *pad,
45 	  wchar_t *spec);
46 void __printf_fp (char *s, struct printf_info *pinfo);
foo(char * s)47 int foo(char *s)
48 {
49   int alt = 0;
50   int space = 0;
51   int left = 0;
52   int showsign = 0;
53   int group = 0;
54   int is_long_double = 0;
55   int is_short = 0;
56   int is_long = 0;
57   int width = 0;
58   int prec = -1;
59   int use_outdigits = 0;
60   unsigned int pad = L' ';
61   wchar_t spec;
62 
63   bar (&alt, &space, &left, &showsign, &group, &is_long_double,
64        &is_short, &is_long, &width, &prec, &use_outdigits, &pad, &spec);
65 
66   a[1] = a[0] + a[2] + a[3] + a[4] + a[5] + a[6];
67   a[2] = a[1] + a[3] + a[5] + a[5] + a[6] + a[7];
68   a[3] = a[2] + a[5] + a[7] + a[6] + a[7] + a[8];
69   a[4] = a[3] + a[7] + a[11] + a[7] + a[8] + a[9];
70   a[5] = a[5] + a[11] + a[13] + a[8] + a[9] + a[10];
71   a[6] = a[7] + a[13] + a[17] + a[9] + a[10] + a[11];
72   a[7] = a[11] + a[17] + a[19] + a[10] + a[11] + a[12];
73   a[8] = a[17] + a[19] + a[23] + a[29] + a[31] + a[37];
74 
75   {
76     struct printf_info info;
77     memset (&info, 0, sizeof (struct printf_info));
78     info.prec = prec;
79     info.width = width;
80     info.spec = spec;
81     info.is_long_double = is_long_double;
82     info.is_short = is_short;
83     info.is_long = is_long;
84     info.alt = alt;
85     info.space = space;
86     info.left = left;
87     info.showsign = showsign;
88     info.group = group;
89     info.pad = pad;
90     info.extra = 0;
91     info.i18n = use_outdigits;
92     info.wide = sizeof (wchar_t) != 1;
93 
94     __printf_fp (s, &info);
95   }
96 
97   return 0;
98 }
99 
100