summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/pointer-arithmetic.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-21 05:56:30 +0000
committerChris Lattner <sabre@nondot.org>2007-08-21 05:56:30 +0000
commit85e9b4336a1c6f9e22978f1f6894027773622495 (patch)
tree77aed0a08979d49943fe91544e761cccb5a36953 /clang/test/Parser/pointer-arithmetic.c
parentb01cc9d49a3f872f160c9723463910101d429a86 (diff)
downloadbcm5719-llvm-85e9b4336a1c6f9e22978f1f6894027773622495.tar.gz
bcm5719-llvm-85e9b4336a1c6f9e22978f1f6894027773622495.zip
add a testcase I forgot to check in long ago
llvm-svn: 41219
Diffstat (limited to 'clang/test/Parser/pointer-arithmetic.c')
-rw-r--r--clang/test/Parser/pointer-arithmetic.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Parser/pointer-arithmetic.c b/clang/test/Parser/pointer-arithmetic.c
new file mode 100644
index 00000000000..7c7e3ad0429
--- /dev/null
+++ b/clang/test/Parser/pointer-arithmetic.c
@@ -0,0 +1,9 @@
+// RUN: clang -parse-ast-check %s
+
+int *test1(int *a) { return a + 1; }
+int *test2(int *a) { return 1 + a; }
+int *test3(int *a) { return a - 1; }
+int test4(int *a, int *b) { return a - b; }
+
+int test5(int *a, int *b) { return a + b; } /* expected-error {{invalid operands}} */
+int *test6(int *a) { return 1 - a; } /* expected-error {{invalid operands}} */
OpenPOWER on IntegriCloud