fehler70: wrong mode for array access generated in front end.
authorChristoph Mallon <christoph.mallon@gmx.de>
Tue, 14 Aug 2007 12:03:05 +0000 (12:03 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Tue, 14 Aug 2007 12:03:05 +0000 (12:03 +0000)
[r15534]

ir/be/test/fehler70.c [new file with mode: 0644]

diff --git a/ir/be/test/fehler70.c b/ir/be/test/fehler70.c
new file mode 100644 (file)
index 0000000..ecc6ac5
--- /dev/null
@@ -0,0 +1,20 @@
+typedef struct s {
+       char a;
+       char b;
+} s;
+
+s a[129];
+s* b = a;
+
+void f(unsigned char i)
+{
+       printf("%d %d (should be 23 42)\n", b[i].a, b[i].b);
+}
+
+
+int main(void)
+{
+       b[128].a = 23;
+       b[128].b = 42;
+       f(128);
+}