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. */ 22 typedef __ea int ea_int_t; 23 typedef __ea int *ea_int_star_t; 24 typedef int outer_t; 25 26 /* Externs. */ 27 28 __ea extern int i1; 29 extern __ea int i2; 30 extern int __ea i3; 31 extern __ea ea_int_t i4; /* __ea qualifier permitted via typedef. */ 32 extern int __ea __ea __ea dupe; /* __ea duplicate permitted directly. */ 33 extern int __ea *ppu; 34 35 /* Pointers. */ 36 __ea int *i4p; 37 38 /* Structs. */ 39 struct st { 40 __ea int *p; 41 }; 42 43 /* Variable definitions. */ 44 __ea int ii0; 45 int *__ea ii1; 46 static int __ea ii2; 47 48 void f1()49f1 () 50 { 51 int *spu; 52 ppu = (ea_int_t *) spu; 53 ppu = (ea_int_star_t) spu; 54 } 55 56 void f2()57f2 () 58 { 59 int *spu; 60 spu = (int *) ppu; 61 ppu = (__ea int *) spu; 62 } 63 64 void f3()65f3 () 66 { 67 int i = sizeof (__ea int); 68 } 69 f4(void)70__ea int *f4 (void) 71 { 72 return 0; 73 } 74 f5(__ea int * parm)75int f5 (__ea int *parm) 76 { 77 static __ea int local4; 78 int tmp = local4; 79 local4 = *parm; 80 return tmp; 81 } 82 f6(__ea void * start)83static inline __ea void *f6 (__ea void *start) 84 { 85 return 0; 86 } 87 f7(void)88void f7 (void) 89 { 90 __ea void *s1; 91 auto __ea void *s2; 92 } 93 f8(__ea int * x)94__ea int *f8 (__ea int *x) 95 { 96 register __ea int *y = x; 97 __ea int *z = y; 98 return z; 99 } 100 f9(__ea long long x[2])101long long f9 (__ea long long x[2]) 102 { 103 return x[0] + x[1]; 104 } 105 f10()106void f10 () 107 { 108 static __ea outer_t o; 109 } 110