diff --git a/test/FrontendC/arrayderef.c b/test/FrontendC/arrayderef.c new file mode 100644 index 00000000000..66c2e0ba416 --- /dev/null +++ b/test/FrontendC/arrayderef.c @@ -0,0 +1,17 @@ +// RUN: %llvmgcc %s -S -O -o - | FileCheck %s +// The load here was getting lost because this code was close +// enough to the traditional (wrong) implementation of offsetof +// to confuse the gcc FE. 8629268. + +struct foo { + int x; + int *y; +}; + +struct foo Foo[1]; + +int * bar(unsigned int ix) { +// CHECK: load + return &Foo->y[ix]; +} +