aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/980618-2.c
blob: c97e19e627f75ae41cfd6c7a11c253284ed3a1ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
typedef char CHAR;
typedef short SHORT;
typedef int INT;
typedef long LONG;
typedef float FLOAT;
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned int UINT;
typedef unsigned long ULONG;
typedef double DOUBLE;
#if __STDC__
typedef signed char SCHAR;
typedef long double LDOUBLE;
#endif

int 
main ()
{
  typedef union
    {
      CHAR c;
      SHORT s;
      INT i;
      UCHAR uc;
      USHORT us;
      UINT ui;
      LONG l;
      ULONG ul;
      FLOAT f;
      DOUBLE d;
#if __STDC__
      SCHAR sc;
      LDOUBLE ld;
#endif
    }
  D;
  auto D D1;
  D1.c = 7;
  {
    auto struct
      {
	CHAR c;
	SHORT s;
	INT i;
	UCHAR uc;
	USHORT us;
	UINT ui;
	LONG l;
	ULONG ul;
	FLOAT f;
	DOUBLE d;
#if __STDC__
	SCHAR sc;
	LDOUBLE ld;
#endif
      }
    F;
    F.c = 7;
    if ((D1.c && F.c) != 1)
      abort ();
    if ((F.c && D1.c) != 1)
      abort ();
  }

  exit (0);
}