aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/strub-var1.c
blob: 67014aa5de84a733a153a02f191986e5aa890d02 (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
/* { dg-do compile } */
/* { dg-require-effective-target strub } */

int __attribute__ ((strub)) x;
float __attribute__ ((strub)) f;
double __attribute__ ((strub)) d;

/* The attribute applies to the type of the declaration, i.e., to the pointer
   variable p, not to the pointed-to integer.  */
int __attribute__ ((strub)) *
p = &x; /* { dg-message "incompatible|invalid conversion" } */

typedef int __attribute__ ((strub)) strub_int;
strub_int *q = &x; /* Now this is compatible.  */

int __attribute__ ((strub))
a[2]; /* { dg-warning "does not apply to elements" } */

int __attribute__ ((vector_size (4 * sizeof (int))))
    __attribute__ ((strub))
v; /* { dg-warning "does not apply to elements" } */

struct s {
  int i, j;
} __attribute__ ((strub)) w; /* { dg-warning "does not apply to fields" } */