aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr98793.c
blob: bb1ae9cc7b1abcbf5f2ca00687961e2322cffdfa (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
/* { dg-do run } */
/* { dg-options "-O2 -Wno-psabi" } */

typedef unsigned char u8;
typedef unsigned char __attribute__((__vector_size__ (8))) v64u8;
typedef unsigned char __attribute__((__vector_size__ (64))) v512u8;
typedef unsigned long long u64;

u64 gx;
v512u8 gu;
v512u8 gv;

v64u8 __attribute__((__noipa__)) foo0 (u8 ax, v512u8 au, u64 ay)
{
  u8 lx = ax && (u8) ay;
  v512u8 lc = 7 <= au;
  v512u8 ld = (u8) (ay && gx) == gu;
  v512u8 le = (v512u8) ld + (v512u8) gv;
  v512u8 lf = le + lc;
  return (((union
            {
            v512u8 a;
            v64u8 b[8];
            }) lf).b[3]) + lx;
}

int
main (void)
{
  v64u8 x = foo0 (2, (v512u8) { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15
                  },
                  2);
  for (unsigned i = 0; i < sizeof (x); i++)
    if (x[i] != (i ? 0 : 0xff))
      __builtin_abort ();
  return 0;
}