diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
commit | ec2b103c267a06a66e926f62cd96767b280f5cf5 (patch) | |
tree | ce7d964cbb5e39695b71481698f10cb099c23d4a /test/CodeGen/pointer-arithmetic.c |
Notes
Diffstat (limited to 'test/CodeGen/pointer-arithmetic.c')
-rw-r--r-- | test/CodeGen/pointer-arithmetic.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/pointer-arithmetic.c b/test/CodeGen/pointer-arithmetic.c new file mode 100644 index 0000000000000..5049875dd3ed2 --- /dev/null +++ b/test/CodeGen/pointer-arithmetic.c @@ -0,0 +1,22 @@ +// RUN: clang-cc -S %s -o - + +typedef int Int; + +int f0(int *a, Int *b) { return a - b; } + +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_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); } +void *f4(void *a, int b) { return a - b; } +void *f4_1(void *a, int b) { return (a -= b); } +FP f5(FP a, int b) { return a + b; } +FP f5_1(FP a, int b) { return (a += b); } +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); } |