blob: 3d7bccaf97588d160b0fe8fd8bada4bbfe30bdf0 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -fsyntax-only -verify
Chris Lattnerd7d860d2007-12-18 06:06:23 +00002
3const char* test1 = 1 ? "i" : 1 == 1 ? "v" : "r";
4
Nuno Lopesd8de7252008-06-04 19:14:12 +00005void _efree(void *ptr);
Chris Lattnere0303582010-01-09 20:43:19 +00006void free(void *ptr);
Nuno Lopesd8de7252008-06-04 19:14:12 +00007
Mike Stump1eb44332009-09-09 15:08:12 +00008int _php_stream_free1() {
Douglas Gregord4eea832010-04-09 00:35:39 +00009 return (1 ? free(0) : _efree(0)); // expected-error {{returning 'void' from a function with incompatible result type 'int'}}
Nuno Lopesd8de7252008-06-04 19:14:12 +000010}
11
Mike Stump1eb44332009-09-09 15:08:12 +000012int _php_stream_free2() {
Douglas Gregord4eea832010-04-09 00:35:39 +000013 return (1 ? _efree(0) : free(0)); // expected-error {{returning 'void' from a function with incompatible result type 'int'}}
Nuno Lopesd8de7252008-06-04 19:14:12 +000014}