1/* Copyright (C) 2009 Free Software Foundation, Inc.
2
3   This file is free software; you can redistribute it and/or modify it under
4   the terms of the GNU General Public License as published by the Free
5   Software Foundation; either version 3 of the License, or (at your option)
6   any later version.
7
8   This file is distributed in the hope that it will be useful, but WITHOUT
9   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11   for more details.
12
13   You should have received a copy of the GNU General Public License
14   along with this file; see the file COPYING3.  If not see
15   <http://www.gnu.org/licenses/>.  */
16
17/* Valid __ea declarations.  */
18
19/* { dg-do compile } */
20
21/* Typedefs.  */
22typedef __ea int ea_int_t;
23typedef __ea int *ea_int_star_t;
24typedef int outer_t;
25
26/* Externs.  */
27
28__ea extern int i1;
29extern __ea int i2;
30extern int __ea i3;
31extern __ea ea_int_t i4;		/* __ea qualifier permitted via typedef.  */
32extern int __ea __ea __ea dupe;		/* __ea duplicate permitted directly.  */
33extern int __ea *ppu;
34
35/* Pointers.  */
36__ea int *i4p;
37
38/* Structs.  */
39struct st {
40  __ea int *p;
41};
42
43/* Variable definitions.  */
44__ea int ii0;
45int *__ea ii1;
46static int __ea ii2;
47
48void
49f1 ()
50{
51  int *spu;
52  ppu = (ea_int_t *) spu;
53  ppu = (ea_int_star_t) spu;
54}
55
56void
57f2 ()
58{
59  int *spu;
60  spu = (int *) ppu;
61  ppu = (__ea int *) spu;
62}
63
64void
65f3 ()
66{
67  int i = sizeof (__ea int);
68}
69
70__ea int *f4 (void)
71{
72  return 0;
73}
74
75int f5 (__ea int *parm)
76{
77  static __ea int local4;
78  int tmp = local4;
79  local4 = *parm;
80  return tmp;
81}
82
83static inline __ea void *f6 (__ea void *start)
84{
85  return 0;
86}
87
88void f7 (void)
89{
90  __ea void *s1;
91  auto __ea void *s2;
92}
93
94__ea int *f8 (__ea int *x)
95{
96  register __ea int *y = x;
97  __ea int *z = y;
98  return z;
99}
100
101long long f9 (__ea long long x[2])
102{
103  return x[0] + x[1];
104}
105
106void f10 ()
107{
108  static __ea outer_t o;
109}
110