blob: d3e5c0b9384b98077dab9033935e2d5a33945235 [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}
Eli Friedman145c0832008-05-16 17:37:11 +000028
29void test6();
30void test7(int);
31void* test8() {return 1 ? test6 : test7;}
32