[cfe-commits] r41219 - /cfe/trunk/test/Parser/pointer-arithmetic.c

Chris Lattner sabre at nondot.org
Mon Aug 20 22:56:30 PDT 2007


Author: lattner
Date: Tue Aug 21 00:56:30 2007
New Revision: 41219

URL: http://llvm.org/viewvc/llvm-project?rev=41219&view=rev
Log:
add a testcase I forgot to check in long ago


Added:
    cfe/trunk/test/Parser/pointer-arithmetic.c

Added: cfe/trunk/test/Parser/pointer-arithmetic.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/pointer-arithmetic.c?rev=41219&view=auto

==============================================================================
--- cfe/trunk/test/Parser/pointer-arithmetic.c (added)
+++ cfe/trunk/test/Parser/pointer-arithmetic.c Tue Aug 21 00:56:30 2007
@@ -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}} */





More information about the cfe-commits mailing list