diff options
Diffstat (limited to 'test/CodeGen/pointer-arithmetic.c')
-rw-r--r-- | test/CodeGen/pointer-arithmetic.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/test/CodeGen/pointer-arithmetic.c b/test/CodeGen/pointer-arithmetic.c index 3133c9effe..23a6ab41a1 100644 --- a/test/CodeGen/pointer-arithmetic.c +++ b/test/CodeGen/pointer-arithmetic.c @@ -1,7 +1,22 @@ -// RUN: clang -emit-llvm %s -o %t +// RUN: clang -S %s -o %t typedef int Int; -int test1(int *a, Int *b) { return a - b; } +int f0(int *a, Int *b) { return a - b; } -int test2(const char *a, char *b) { return b - a; } +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); } |