Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / other / pr56184.C
blobb491f75bff7dec9fa48b725cff5ae316455dda22
1 /* { dg-do compile { target arm*-*-* } } */
2 /* { dg-require-effective-target arm_arch_v7a_neon_thumb_ok } */
3 /* { dg-options "-fno-short-enums -O2 -fno-section-anchors -Wno-return-type" } */
4 /* { dg-add-options arm_arch_v7a_neon_thumb } */
5 /* { dg-additional-options "-mtune=cortex-a9" } */
8 typedef unsigned int size_t;
9 __extension__ typedef int __intptr_t;
10 typedef __intptr_t intptr_t;
11 typedef union tree_node *tree;
12 typedef const union tree_node *const_tree;
13 extern void *ggc_internal_cleared_alloc_stat (size_t )
14   __attribute__ ((__malloc__));
15 enum tree_code {
16 TREE_LIST=2,
17 FUNCTION_DECL,
18 MAX_TREE_CODES=254
20 extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
21 struct tree_base {
22   enum tree_code code : 16;
24 struct tree_common {
25   tree chain;
27 enum tree_node_structure_enum {
28 TS_COMMON,
29 TS_DECL_COMMON,
31 extern void tree_contains_struct_check_failed (const_tree,
32             const enum tree_node_structure_enum,
33             const char *, int, const char *)
34   __attribute__ ((__noreturn__));
35 extern void tree_check_failed (const_tree, const char *, int, const char *,
36           ...) __attribute__ ((__noreturn__));
37 struct tree_list {
38   tree value;
40 struct tree_decl_common {
41   tree initial;
43 struct tree_function_decl {
44   struct function *f;
46 union
47                                                          tree_node {
48   struct tree_base base;
49   struct tree_common common;
50   struct tree_decl_common decl_common;
51   struct tree_function_decl function_decl;
52   struct tree_list list;
54 inline tree
55 tree_check (tree __t, const char *__f, int __l, const char *__g, enum tree_code __c)
57   if (((enum tree_code) (__t)->base.code) != __c)
58     tree_check_failed (__t, __f, __l, __g, __c, 0);
60 inline tree
61 contains_struct_check (tree __t, const enum tree_node_structure_enum __s,
62                        const char *__f, int __l, const char *__g)
64   if (tree_contains_struct[((enum tree_code) (__t)->base.code)][__s] != 1)
65       tree_contains_struct_check_failed (__t, __s, __f, __l, __g);
67 struct function {
68   tree static_chain_decl;
70 enum gimple_code {
71     LAST_AND_UNUSED_GIMPLE_CODE
73 struct eh_catch_d
75   struct eh_catch_d *next_catch;
76   struct eh_catch_d *prev_catch;
77   tree type_list;
78   tree filter_list;
79   tree label;
81 struct eh_region_d
83   struct eh_region_d *outer;
84   struct eh_region_d *inner;
85   int index;
86   union eh_region_u {
87     struct eh_region_u_try {
88       struct eh_catch_d *first_catch;
89     } eh_try;
90   } u;
92 typedef struct eh_catch_d *eh_catch;
93 typedef struct eh_region_d *eh_region;
94 extern void add_type_for_runtime (tree);
95 enum LTO_tags
97   LTO_null = 0,
98   LTO_bb0 = 1 + MAX_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE,
99   LTO_ert_cleanup,
100   LTO_NUM_TAGS
102 enum lto_section_type
104   LTO_section_function_body,
106 struct lto_input_block
108   const char *data;
109   unsigned int p;
110   unsigned int len;
112 extern void lto_section_overrun (struct lto_input_block *) __attribute__ ((__noreturn__));
113 extern void lto_value_range_error (const char *,
114        long long, long long,
115        long long) __attribute__ ((__noreturn__));
116 long long streamer_read_hwi (struct lto_input_block *);
117 static inline unsigned char
118 streamer_read_uchar (struct lto_input_block *ib)
120   if (ib->p >= ib->len)
121     lto_section_overrun (ib);
122   return (ib->data[ib->p++]);
124 static inline long long
125 streamer_read_hwi_in_range (struct lto_input_block *ib,
126      const char *purpose,
127      long long min,
128      long long max)
130   long long range = max - min;
131   long long val = streamer_read_uchar (ib);
132   if (range >= 0xff)
133     val |= ((long long)streamer_read_uchar (ib)) << 8;
134   if (val < min || val > max)
135     lto_value_range_error (purpose, val, min, max);
136   return val;
138 static inline enum LTO_tags
139 streamer_read_record_start (struct lto_input_block *ib)
141   return (enum LTO_tags)streamer_read_hwi_in_range ((ib), "LTO_tags", 0, (int)(LTO_NUM_TAGS) - 1);
143 struct streamer_hooks {
144   tree (*read_tree) (struct lto_input_block *, struct data_in *);
146 extern struct streamer_hooks streamer_hooks;
147 static struct eh_catch_d *
148 lto_input_eh_catch_list (struct lto_input_block *ib, struct data_in *data_in,
149     eh_catch *last_p)
151   eh_catch first;
152   enum LTO_tags tag;
153   *last_p = first = __null;
154   tag = streamer_read_record_start (ib);
155   while (tag)
156     {
157       tree list;
158       eh_catch n;
159       n = ((struct eh_catch_d *)(ggc_internal_cleared_alloc_stat (sizeof (struct eh_catch_d) )));
160       n->type_list = streamer_hooks.read_tree(ib, data_in);
161       n->filter_list = streamer_hooks.read_tree(ib, data_in);
162       n->label = streamer_hooks.read_tree(ib, data_in);
163       for (list = n->filter_list; list; list = ((contains_struct_check ((list), (TS_COMMON), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 275, __FUNCTION__))->common.chain))
164  add_type_for_runtime (((tree_check ((list), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 276, __FUNCTION__, (TREE_LIST)))->list.value));
165       if (*last_p)
166  (*last_p)->next_catch = n;
167       n->prev_catch = *last_p;
168       *last_p = n;
169       if (first == __null)
170  first = n;
171       tag = streamer_read_record_start (ib);
172     }
173   return first;
175 static eh_region
176 input_eh_region (struct lto_input_block *ib, struct data_in *data_in, int ix)
178   enum LTO_tags tag;
179   eh_region r;
180   tag = streamer_read_record_start (ib);
181   if (tag == LTO_null)
182     return __null;
183   r = ((struct eh_region_d *)(ggc_internal_cleared_alloc_stat (sizeof (struct eh_region_d) )));
184   r->index = streamer_read_hwi (ib);
185   r->outer = (eh_region) (intptr_t) streamer_read_hwi (ib);
186   r->inner = (eh_region) (intptr_t) streamer_read_hwi (ib);
187   switch (tag)
188     {
189       case LTO_ert_cleanup:
191    struct eh_catch_d *last_catch;
192    r->u.eh_try.first_catch = lto_input_eh_catch_list (ib, data_in,
193             &last_catch);
196    tree l;
197      add_type_for_runtime (((tree_check ((l), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 346, __FUNCTION__, (TREE_LIST)))->list.value));
199     }
201 static void
202 input_eh_regions (struct lto_input_block *ib, struct data_in *data_in,
203     struct function *fn)
205   long long i, root_region, len;
206   enum LTO_tags tag;
207   tag = streamer_read_record_start (ib);
208   if (tag == LTO_null)
209     return;
210   len = streamer_read_hwi (ib);
211   if (len > 0)
212     {
213       for (i = 0; i < len; i++)
215    eh_region r = input_eh_region (ib, data_in, i);
217     }
219 static void
220 input_ssa_names (struct lto_input_block *ib, struct data_in *data_in,
221    struct function *fn)
223   unsigned int i, size;
224   while (i)
225     {
226     }
228 static void
229 input_struct_function_base (struct function *fn, struct data_in *data_in,
230                             struct lto_input_block *ib)
232   fn->static_chain_decl = streamer_hooks.read_tree(ib, data_in);
234 static void
235 input_function (tree fn_decl, struct data_in *data_in,
236   struct lto_input_block *ib)
238   struct function *fn;
239   enum LTO_tags tag;
240   fn = ((tree_check ((fn_decl), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 807, __FUNCTION__, (FUNCTION_DECL)))->function_decl.f);
241   tag = streamer_read_record_start (ib);
242   input_struct_function_base (fn, data_in, ib);
243   input_ssa_names (ib, data_in, fn);
244   input_eh_regions (ib, data_in, fn);
245   ((contains_struct_check ((fn_decl), (TS_DECL_COMMON), "../../../gcc-4.8~svn195526/gcc/lto-streamer-in.c", 823, __FUNCTION__))->decl_common.initial) = streamer_hooks.read_tree(ib, data_in);
247 static void
248 lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl,
249         const char *data, enum lto_section_type section_type)
251   struct data_in *data_in;
252   struct lto_input_block ib_main;
253   input_function (fn_decl, data_in, &ib_main);
255 void
256 lto_input_function_body (struct lto_file_decl_data *file_data,
257     tree fn_decl, const char *data)
259   lto_read_body (file_data, fn_decl, data, LTO_section_function_body);