blob: 22286705c89c1f4cd8cec12633f1e171c03857c3 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -emit-llvm %s -o %t
Chris Lattner8da1cb62007-07-13 20:18:44 +00002
3float test1(int cond, float a, float b)
4{
5 return cond ? a : b;
6}
Chris Lattner8da1cb62007-07-13 20:18:44 +00007double test2(int cond, float a, double b)
8{
9 return cond ? a : b;
10}
Chris Lattner2202bce2007-11-30 17:56:23 +000011
12void f();
13
14void test3(){
15 1 ? f() : (void)0;
16}
17
Eli Friedmanb1284ac2008-01-30 17:02:03 +000018void test4() {
19int i; short j;
20float* k = 1 ? &i : &j;
21}
Eli Friedman68f624e2008-02-10 23:18:23 +000022
23void test5() {
24 const int* cip;
25 void* vp;
26 cip = 0 ? vp : cip;
27}
Eli Friedman145c0832008-05-16 17:37:11 +000028
29void test6();
30void test7(int);
31void* test8() {return 1 ? test6 : test7;}
32
Nuno Lopes108f55d2008-06-04 19:15:45 +000033
34void _efree(void *ptr);
35
36void _php_stream_free3()
37{
38 (1 ? free(0) : _efree(0));
39}
40
41void _php_stream_free4()
42{
43 1 ? _efree(0) : free(0);
44}