aboutsummaryrefslogtreecommitdiff
path: root/test/FrontendC/arrayderef.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-02-20 12:57:14 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-02-20 12:57:14 +0000
commitcf099d11218cb6f6c5cce947d6738e347f07fb12 (patch)
treed2b61ce94e654cb01a254d2195259db5f9cc3f3c /test/FrontendC/arrayderef.c
parent49011b52fcba02a6051957b84705159f52fae4e4 (diff)
Diffstat (limited to 'test/FrontendC/arrayderef.c')
-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 000000000000..66c2e0ba4165
--- /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];
+}
+