blob: 3d7bccaf97588d160b0fe8fd8bada4bbfe30bdf0 [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -fsyntax-only -verify
Chris Lattnerdcb7cc52007-12-18 06:06:23 +00002
3const char* test1 = 1 ? "i" : 1 == 1 ? "v" : "r";
4
Nuno Lopes28bcfec2008-06-04 19:14:12 +00005void _efree(void *ptr);
Chris Lattnerf9895c42010-01-09 20:43:19 +00006void free(void *ptr);
Nuno Lopes28bcfec2008-06-04 19:14:12 +00007
Mike Stump11289f42009-09-09 15:08:12 +00008int _php_stream_free1() {
Douglas Gregorc68e1402010-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 Lopes28bcfec2008-06-04 19:14:12 +000010}
11
Mike Stump11289f42009-09-09 15:08:12 +000012int _php_stream_free2() {
Douglas Gregorc68e1402010-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 Lopes28bcfec2008-06-04 19:14:12 +000014}