aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-11-07 04:58:48 +0000
committerDale Johannesen <dalej@apple.com>2010-11-07 04:58:48 +0000
commit7944988c2588c8015115b874a6bafd8f6fff7e25 (patch)
tree364b50ca0eb6cdb7bc5db2ce06ab037f41f43b61
parent9e07a149b079a28916cdd9d70849cd42344b54d0 (diff)
Testcase for llvm-gcc 118368. 8629268.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118369 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/FrontendC/arrayderef.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/FrontendC/arrayderef.c b/test/FrontendC/arrayderef.c
new file mode 100644
index 0000000000..66c2e0ba41
--- /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];
+}
+