diff options
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/pr36093.c')
-rw-r--r-- | SingleSource/Regression/C/gcc-c-torture/execute/pr36093.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/pr36093.c b/SingleSource/Regression/C/gcc-c-torture/execute/pr36093.c new file mode 100644 index 00000000..dac5720f --- /dev/null +++ b/SingleSource/Regression/C/gcc-c-torture/execute/pr36093.c @@ -0,0 +1,30 @@ +/* { dg-skip-if "small alignment" { pdp11-*-* } } */ + +extern void abort (void); + +typedef struct Bar { + char c[129]; +} Bar __attribute__((__aligned__(128))); + +typedef struct Foo { + Bar bar[4]; +} Foo; + +Foo foo[4]; + +int main() +{ + int i, j; + Foo *foop = &foo[0]; + + for (i=0; i < 4; i++) { + Bar *bar = &foop->bar[i]; + for (j=0; j < 129; j++) { + bar->c[j] = 'a' + i; + } + } + + if (foo[0].bar[3].c[128] != 'd') + abort (); + return 0; +} |