(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
pr53037-4.c
       1  /* PR c/53037.  */
       2  /* { dg-do compile } */
       3  /* { dg-options "-O0" } */
       4  
       5  int foo1 __attribute__((warn_if_not_aligned(8))); /* { dg-error "'warn_if_not_aligned' may not be specified for 'foo1'" } */
       6  
       7  __attribute__((warn_if_not_aligned(8)))
       8  void
       9  foo2 (void) /* { dg-error "'warn_if_not_aligned' may not be specified for 'foo2'" } */
      10  {
      11  }
      12  
      13  struct foo3
      14  {
      15    int i : 2 __attribute__((warn_if_not_aligned(8))); /* { dg-error "'warn_if_not_aligned' may not be specified for 'i'" } */
      16  };
      17  
      18  typedef unsigned int __u32
      19    __attribute__((aligned(4),warn_if_not_aligned(8)));
      20  
      21  struct foo4
      22  {
      23    __u32 i : 2; /* { dg-error "cannot declare bit-field 'i' with 'warn_if_not_aligned' type" } */
      24  };