diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-07-26 00:57:24 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-07-26 00:57:24 +0000 |
| commit | 89026888ef6f80b5e271c3d08666001f998eca74 (patch) | |
| tree | 4db64af10923c54338f7f15966720bbe19e51eee /clang/test/SemaObjC/argument-checking.m | |
| parent | a075e63bbca031f3d5794e888252cab265cc058c (diff) | |
| download | bcm5719-llvm-89026888ef6f80b5e271c3d08666001f998eca74.tar.gz bcm5719-llvm-89026888ef6f80b5e271c3d08666001f998eca74.zip | |
move all objc sema tests into a new SemaObjC directory. Next step is to
remove the objc- prefix from the tests that use it.
llvm-svn: 54084
Diffstat (limited to 'clang/test/SemaObjC/argument-checking.m')
| -rw-r--r-- | clang/test/SemaObjC/argument-checking.m | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/argument-checking.m b/clang/test/SemaObjC/argument-checking.m new file mode 100644 index 00000000000..820a2f09c79 --- /dev/null +++ b/clang/test/SemaObjC/argument-checking.m @@ -0,0 +1,25 @@ +// RUN: clang -fsyntax-only -verify -pedantic %s + +struct S { int a; }; + +extern int charStarFunc(char *); +extern int charFunc(char); + +@interface Test ++alloc; +-(int)charStarMeth:(char *)s; +-structMeth:(struct S)s; +-structMeth:(struct S)s :(struct S)s2; +@end + +void test() { + id obj = [Test alloc]; + struct S sInst; + + charStarFunc(1); // expected-warning {{incompatible integer to pointer conversion passing 'int', expected 'char *'}} + charFunc("abc"); // expected-warning {{incompatible pointer to integer conversion passing 'char [4]', expected 'char'}} + + [obj charStarMeth:1]; // expected-warning {{incompatible integer to pointer conversion sending 'int'}} + [obj structMeth:1]; // expected-error {{incompatible type sending 'int'}} + [obj structMeth:sInst :1]; // expected-error {{incompatible type sending 'int'}} +} |

