gcc/testsuite/gcc.c-torture/execute/zero-struct-2.c
raw| 1 | void abort (void); |
| 2 | int ii; |
| 3 | typedef struct {} raw_spinlock_t; |
| 4 | typedef struct { |
| 5 | raw_spinlock_t raw_lock; |
| 6 | } spinlock_t; |
| 7 | raw_spinlock_t one_raw_spinlock (void) |
| 8 | { |
| 9 | raw_spinlock_t raw_lock; |
| 10 | ii++; |
| 11 | return raw_lock; |
| 12 | } |
| 13 | int main(void) |
| 14 | { |
| 15 | spinlock_t lock = (spinlock_t) { .raw_lock = one_raw_spinlock() }; |
| 16 | if (ii != 1) |
| 17 | abort (); |
| 18 | return 0; |
| 19 | } |
| 20 |