OSDN Git Service

Fix PR 17408 and PR 17409.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / 20001026-1.c
1 extern void abort (void);
2
3 typedef struct {
4   long r[(19 + sizeof (long))/(sizeof (long))];
5 } realvaluetype;
6
7 typedef void *tree;
8
9 static realvaluetype
10 real_value_from_int_cst (tree x, tree y)
11 {
12   realvaluetype r;
13   int i;
14   for (i = 0; i < sizeof(r.r)/sizeof(long); ++i)
15     r.r[i] = -1;
16   return r;
17 }
18
19 struct brfic_args
20 {
21   tree type;
22   tree i;
23   realvaluetype d;
24 };
25
26 static void
27 build_real_from_int_cst_1 (data)
28      void * data;
29 {
30   struct brfic_args *args = (struct brfic_args *) data;
31   args->d = real_value_from_int_cst (args->type, args->i);
32 }
33
34 int main()
35 {
36   struct brfic_args args;
37
38   __builtin_memset (&args, 0, sizeof(args));
39   build_real_from_int_cst_1 (&args);
40
41   if (args.d.r[0] == 0)
42     abort ();
43   return 0;
44 }