blob: c37968b7b93821f413f242fb994204769afdbd54 [file] [log] [blame]
Chris Lattner4dcf151a2009-04-22 05:57:30 +00001// Test this without pch.
Daniel Dunbara5728872009-12-15 20:14:24 +00002// RUN: %clang_cc1 -fblocks -include %S/objc_exprs.h -fsyntax-only -verify %s
Chris Lattner4dcf151a2009-04-22 05:57:30 +00003
4// Test with pch.
Daniel Dunbara5728872009-12-15 20:14:24 +00005// RUN: %clang_cc1 -x objective-c-header -emit-pch -fblocks -o %t %S/objc_exprs.h
6// RUN: %clang_cc1 -fblocks -include-pch %t -fsyntax-only -verify %s
Chris Lattner4dcf151a2009-04-22 05:57:30 +00007
Chris Lattnerd7a3fcd2009-04-22 06:40:03 +00008// Expressions
Steve Naroff14108da2009-07-10 23:34:53 +00009int *A1 = (objc_string)0; // expected-warning {{aka 'id'}}
Chris Lattner3a57a372009-04-22 06:29:42 +000010
Chris Lattnerd7a3fcd2009-04-22 06:40:03 +000011char A2 = (objc_encode){}; // expected-error {{not a compile-time constant}} \
Chris Lattner3a57a372009-04-22 06:29:42 +000012 expected-warning {{char [2]}}
13
14int *A3 = (objc_protocol)0; // expected-warning {{aka 'Protocol *'}}
15
16
Chris Lattnerd7a3fcd2009-04-22 06:40:03 +000017// Types.
Steve Naroff14108da2009-07-10 23:34:53 +000018int *T0 = (objc_id_protocol_ty)0; // expected-warning {{aka 'id<foo>'}}
Chris Lattnerd7a3fcd2009-04-22 06:40:03 +000019
Chris Lattnerc6fa4452009-04-22 06:45:28 +000020int *T1 = (objc_interface_ty)0; // expected-warning {{aka 'itf *'}}
21int *T2 = (objc_qual_interface_ty)0; // expected-warning {{aka 'itf<foo> *'}}
Chris Lattner3a57a372009-04-22 06:29:42 +000022
Steve Naroff90cd1bb2009-04-23 10:39:46 +000023objc_selector_noArgs s1;
24objc_selector_oneArg s2;
25objc_selector_twoArg s3;
26
27