* expmed.c (flip_storage_order): Deal with complex modes specially.
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr39339.c
blob6c1b9e72ede0a5a0d2fd61cb7bade14a45923119
1 struct C
3 unsigned int c;
4 struct D
6 unsigned int columns : 4;
7 unsigned int fore : 12;
8 unsigned int back : 6;
9 unsigned int fragment : 1;
10 unsigned int standout : 1;
11 unsigned int underline : 1;
12 unsigned int strikethrough : 1;
13 unsigned int reverse : 1;
14 unsigned int blink : 1;
15 unsigned int half : 1;
16 unsigned int bold : 1;
17 unsigned int invisible : 1;
18 unsigned int pad : 1;
19 } attr;
22 struct A
24 struct C *data;
25 unsigned int len;
28 struct B
30 struct A *cells;
31 unsigned char soft_wrapped : 1;
34 struct E
36 long row, col;
37 struct C defaults;
40 __attribute__ ((noinline))
41 void foo (struct E *screen, unsigned int c, int columns, struct B *row)
43 struct D attr;
44 long col;
45 int i;
46 col = screen->col;
47 attr = screen->defaults.attr;
48 attr.columns = columns;
49 row->cells->data[col].c = c;
50 row->cells->data[col].attr = attr;
51 col++;
52 attr.fragment = 1;
53 for (i = 1; i < columns; i++)
55 row->cells->data[col].c = c;
56 row->cells->data[col].attr = attr;
57 col++;
61 int
62 main (void)
64 struct E e = {.row = 5,.col = 0,.defaults =
65 {6, {-1, -1, -1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0}} };
66 struct C c[4];
67 struct A a = { c, 4 };
68 struct B b = { &a, 1 };
69 struct D d;
70 __builtin_memset (&c, 0, sizeof c);
71 foo (&e, 65, 2, &b);
72 d = e.defaults.attr;
73 d.columns = 2;
74 if (__builtin_memcmp (&d, &c[0].attr, sizeof d))
75 __builtin_abort ();
76 d.fragment = 1;
77 if (__builtin_memcmp (&d, &c[1].attr, sizeof d))
78 __builtin_abort ();
79 return 0;