OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [spu/] [ea/] [errors2.c] - Blame information for rev 327

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 327 jeremybenn
/* 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
/* Invalid __ea declarations.  */
18
 
19
/* { dg-do compile } */
20
 
21
__ea char ea_str[] = "abc";
22
char lm_str[] = "abc";
23
 
24
__ea char *lm_ea_ptr1 = "abc";                          /* { dg-error "initializer element is not computable at load time" } */
25
__ea char *lm_ea_ptr2 = (__ea char *)"abc";             /* { dg-error "initializer element is not constant" } */
26
__ea char *lm_ea_ptr3 = ea_str;
27
__ea char *lm_ea_ptr4 = (__ea char *)ea_str;
28
__ea char *lm_ea_ptr5 = lm_str;                         /* { dg-error "initializer element is not computable at load time" } */
29
__ea char *lm_ea_ptr6 = (__ea char *)lm_str;            /* { dg-error "initializer element is not constant" } */
30
 
31
__ea char * __ea ea_ea_ptr1 = ea_str;
32
__ea char * __ea ea_ea_ptr2 = (__ea char *)ea_str;
33
 
34
char * __ea ea_lm_ptr1 = lm_str;
35
char * __ea ea_lm_ptr2 = (char *)lm_str;
36
 
37
struct foo {
38
  int first;
39
  __ea char *ptr;
40
  int last;
41
};
42
 
43
__ea struct foo ea_struct1 = {
44
  10,
45
  (__ea char *)0,
46
  11,
47
};
48
 
49
__ea struct foo ea_struct2 = {
50
  20,
51
  0,
52
  21,
53
};
54
 
55
struct foo ea_struct3 = {
56
  30,
57
  ea_str,
58
  31,
59
};
60
 
61
struct foo ea_struct4 = {
62
  40,
63
  (__ea char *)lm_str,  /* { dg-error "(initializer element is not constant)|(near initialization)" "" } */
64
  41,
65
};
66
 
67
struct bar {
68
  int first;
69
  char *ptr;
70
  int last;
71
};
72
 
73
__ea struct bar ea_struct5 = {
74
  50,
75
  0,
76
  51,
77
};
78
 
79
__ea struct bar ea_struct6 = {
80
  60,
81
  (char *)0,
82
  61,
83
};
84
 
85
__ea struct bar ea_struct7 = {
86
  70,
87
  lm_str,
88
  71,
89
};
90
 
91
struct bar lm_struct8 = {
92
  80,
93
  0,
94
  81,
95
};
96
 
97
struct bar lm_struct9 = {
98
  90,
99
  (char *)0,
100
  91,
101
};
102
 
103
struct bar lm_struct10 = {
104
  100,
105
  lm_str,
106
  101,
107
};

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.