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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20010924-1.c] - Blame information for rev 715

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
/* Verify that flexible arrays can be initialized from STRING_CST
2
   constructors. */
3
 
4
/* Baselines.  */
5
struct {
6
  char a1c;
7
  char *a1p;
8
} a1 = {
9
  '4',
10
  "62"
11
};
12
 
13
struct {
14
  char a2c;
15
  char a2p[2];
16
} a2 = {
17
  'v',
18
  "cq"
19
};
20
 
21
/* The tests.  */
22
struct {
23
  char a3c;
24
  char a3p[];
25
} a3 = {
26
  'o',
27
  "wx"
28
};
29
 
30
struct {
31
  char a4c;
32
  char a4p[];
33
} a4 = {
34
  '9',
35
  { 'e', 'b' }
36
};
37
 
38
main()
39
{
40
  if (a1.a1c != '4')
41
    abort();
42
  if (a1.a1p[0] != '6')
43
    abort();
44
  if (a1.a1p[1] != '2')
45
    abort();
46
  if (a1.a1p[2] != '\0')
47
    abort();
48
 
49
  if (a2.a2c != 'v')
50
    abort();
51
  if (a2.a2p[0] != 'c')
52
    abort();
53
  if (a2.a2p[1] != 'q')
54
    abort();
55
 
56
  if (a3.a3c != 'o')
57
    abort();
58
  if (a3.a3p[0] != 'w')
59
    abort();
60
  if (a3.a3p[1] != 'x')
61
    abort();
62
 
63
  if (a4.a4c != '9')
64
    abort();
65
  if (a4.a4p[0] != 'e')
66
    abort();
67
  if (a4.a4p[1] != 'b')
68
    abort();
69
 
70
  return 0;
71
}

powered by: WebSVN 2.1.0

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