aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/pointer-arithmetic.c
diff options
context:
space:
mode:
authorAbramo Bagnara <abramo.bagnara@gmail.com>2010-09-13 06:50:07 +0000
committerAbramo Bagnara <abramo.bagnara@gmail.com>2010-09-13 06:50:07 +0000
commit46358457f712a8da89d4e03a17a1d44d35c78b77 (patch)
treea831b740191de3b3ad81031878f5a6c54e30b5ac /test/CodeGen/pointer-arithmetic.c
parent2c5399f99c95b831fa90fd3a3c1d9719c1dd9441 (diff)
Congruent diagnostic for void* arithmetic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113740 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/pointer-arithmetic.c')
-rw-r--r--test/CodeGen/pointer-arithmetic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/CodeGen/pointer-arithmetic.c b/test/CodeGen/pointer-arithmetic.c
index 33465e0aa1..f67a36d66e 100644
--- a/test/CodeGen/pointer-arithmetic.c
+++ b/test/CodeGen/pointer-arithmetic.c
@@ -9,6 +9,7 @@ int f1(const char *a, char *b) { return b - a; }
// GNU extensions
typedef void (*FP)(void);
void *f2(void *a, int b) { return a + b; }
+void *f2_0(void *a, int b) { return &a[b]; }
void *f2_1(void *a, int b) { return (a += b); }
void *f3(int a, void *b) { return a + b; }
void *f3_1(int a, void *b) { return (a += b); }
@@ -20,3 +21,5 @@ FP f6(int a, FP b) { return a + b; }
FP f6_1(int a, FP b) { return (a += b); }
FP f7(FP a, int b) { return a - b; }
FP f7_1(FP a, int b) { return (a -= b); }
+void f8(void *a, int b) { return *(a + b); }
+void f8_1(void *a, int b) { return a[b]; }