Chris Lattner | 4dcf151a | 2009-04-22 05:57:30 +0000 | [diff] [blame] | 1 | // Test this without pch. |
| 2 | // RUN: clang-cc -fblocks -include %S/objc_exprs.h -fsyntax-only -verify %s && |
| 3 | |
| 4 | // Test with pch. |
| 5 | // RUN: clang-cc -x objective-c-header -emit-pch -fblocks -o %t %S/objc_exprs.h && |
| 6 | // RUN: clang-cc -fblocks -include-pch %t -fsyntax-only -verify %s |
| 7 | |
Chris Lattner | d7a3fcd | 2009-04-22 06:40:03 +0000 | [diff] [blame] | 8 | // Expressions |
Chris Lattner | 3a57a37 | 2009-04-22 06:29:42 +0000 | [diff] [blame] | 9 | int *A1 = (objc_string)0; // expected-warning {{'struct objc_object *'}} |
| 10 | |
Chris Lattner | d7a3fcd | 2009-04-22 06:40:03 +0000 | [diff] [blame] | 11 | char A2 = (objc_encode){}; // expected-error {{not a compile-time constant}} \ |
Chris Lattner | 3a57a37 | 2009-04-22 06:29:42 +0000 | [diff] [blame] | 12 | expected-warning {{char [2]}} |
| 13 | |
| 14 | int *A3 = (objc_protocol)0; // expected-warning {{aka 'Protocol *'}} |
| 15 | |
| 16 | |
Chris Lattner | d7a3fcd | 2009-04-22 06:40:03 +0000 | [diff] [blame] | 17 | // Types. |
| 18 | int *T0 = (objc_id_protocol_ty)0; // expected-error {{not a compile-time constant}} \ |
| 19 | expected-warning {{aka 'id<foo>'}} |
| 20 | |
Chris Lattner | c6fa445 | 2009-04-22 06:45:28 +0000 | [diff] [blame] | 21 | int *T1 = (objc_interface_ty)0; // expected-warning {{aka 'itf *'}} |
| 22 | int *T2 = (objc_qual_interface_ty)0; // expected-warning {{aka 'itf<foo> *'}} |
Chris Lattner | 3a57a37 | 2009-04-22 06:29:42 +0000 | [diff] [blame] | 23 | |
Steve Naroff | 90cd1bb | 2009-04-23 10:39:46 +0000 | [diff] [blame^] | 24 | objc_selector_noArgs s1; |
| 25 | objc_selector_oneArg s2; |
| 26 | objc_selector_twoArg s3; |
| 27 | |
| 28 | |