diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/20040308-1.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20040308-1.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040308-1.c b/gcc/testsuite/gcc.c-torture/execute/20040308-1.c new file mode 100644 index 000000000..4c63535e7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20040308-1.c @@ -0,0 +1,21 @@ +/* This used to fail on SPARC with an unaligned memory access. */ + +void foo(int n) +{ + struct S { + int i[n]; + unsigned int b:1; + int i2; + } __attribute__ ((packed)) __attribute__ ((aligned (4))); + + struct S s; + + s.i2 = 0; +} + +int main(void) +{ + foo(4); + + return 0; +} |