aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/cpp/embed-22.c
blob: 1b35cf92012d63baef8e20afe83a41c7da292eaa (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-options "-O2 -Wno-psabi" } */
/* { dg-additional-options "-std=c23" { target c } } */

typedef unsigned char V __attribute__((vector_size (128)));

V a;

void
foo (void)
{
  V b = {
    #embed __FILE__ limit (128) gnu::offset (3)
  };
  a = b;
}

const unsigned char c[] = {
  #embed __FILE__ limit (128) gnu::offset (3)
};

int
main ()
{
  foo ();
  if (__builtin_memcmp (&c[0], &a, sizeof (a)))
    __builtin_abort ();
}