blob: ae4420711502dbf4a29ccbb36bfaf94cbf5973e3 [file] [log] [blame]
Chris Lattner8da1cb62007-07-13 20:18:44 +00001// RUN: clang -emit-llvm %s
2
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}