Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -emit-llvm %s -o %t |
Chris Lattner | 8da1cb6 | 2007-07-13 20:18:44 +0000 | [diff] [blame] | 2 | |
| 3 | float test1(int cond, float a, float b) |
| 4 | { |
| 5 | return cond ? a : b; |
| 6 | } |
Chris Lattner | 8da1cb6 | 2007-07-13 20:18:44 +0000 | [diff] [blame] | 7 | double test2(int cond, float a, double b) |
| 8 | { |
| 9 | return cond ? a : b; |
| 10 | } |
Chris Lattner | 2202bce | 2007-11-30 17:56:23 +0000 | [diff] [blame] | 11 | |
| 12 | void f(); |
| 13 | |
| 14 | void test3(){ |
| 15 | 1 ? f() : (void)0; |
| 16 | } |
| 17 | |
Eli Friedman | b1284ac | 2008-01-30 17:02:03 +0000 | [diff] [blame] | 18 | void test4() { |
| 19 | int i; short j; |
| 20 | float* k = 1 ? &i : &j; |
| 21 | } |
Eli Friedman | 68f624e | 2008-02-10 23:18:23 +0000 | [diff] [blame] | 22 | |
| 23 | void test5() { |
| 24 | const int* cip; |
| 25 | void* vp; |
| 26 | cip = 0 ? vp : cip; |
| 27 | } |
Eli Friedman | 145c083 | 2008-05-16 17:37:11 +0000 | [diff] [blame] | 28 | |
| 29 | void test6(); |
| 30 | void test7(int); |
| 31 | void* test8() {return 1 ? test6 : test7;} |
| 32 | |
Nuno Lopes | 108f55d | 2008-06-04 19:15:45 +0000 | [diff] [blame] | 33 | |
| 34 | void _efree(void *ptr); |
| 35 | |
| 36 | void _php_stream_free3() |
| 37 | { |
| 38 | (1 ? free(0) : _efree(0)); |
| 39 | } |
| 40 | |
| 41 | void _php_stream_free4() |
| 42 | { |
| 43 | 1 ? _efree(0) : free(0); |
| 44 | } |