xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/conditional.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -fsyntax-only -verify
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc const char* test1 = 1 ? "i" : 1 == 1 ? "v" : "r";
4*f4a2713aSLionel Sambuc 
5*f4a2713aSLionel Sambuc void _efree(void *ptr);
6*f4a2713aSLionel Sambuc void free(void *ptr);
7*f4a2713aSLionel Sambuc 
_php_stream_free1()8*f4a2713aSLionel Sambuc int _php_stream_free1() {
9*f4a2713aSLionel Sambuc   return (1 ? free(0) : _efree(0)); // expected-error {{returning 'void' from a function with incompatible result type 'int'}}
10*f4a2713aSLionel Sambuc }
11*f4a2713aSLionel Sambuc 
_php_stream_free2()12*f4a2713aSLionel Sambuc int _php_stream_free2() {
13*f4a2713aSLionel Sambuc   return (1 ? _efree(0) : free(0));  // expected-error {{returning 'void' from a function with incompatible result type 'int'}}
14*f4a2713aSLionel Sambuc }
15