summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr76783.c
blob: 22aef56529f5bdb78d697d7c999e295bbe108d28 (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
/* { dg-do run } */
/* { dg-require-effective-target int128 } */
/* { dg-options "-Og -w -Wno-psabi" } */

typedef unsigned __int128 u128;
typedef unsigned __int128 v64u128 __attribute__ ((vector_size (64)));

u128 __attribute__ ((noinline, noclone))
foo (unsigned c, v64u128 v)
{
  v64u128 u;
  if (c) {
    u = (v64u128){(u128)0, (u128)0};
  } else {
    u = (v64u128){(u128)0, (u128)1};
  }
  u += v;
  return u[1];
}

int
main ()
{
  u128 x = foo (0, (v64u128){ });
  if (x != 1)
    __builtin_abort();
  return 0;
}