blob: 24a5aca57781a937ca3d409b93071cd60b19de65 [file] [log] [blame]
Chris Lattner4b009652007-07-25 00:24:17 +00001// RUN: clang -emit-llvm %s
2
3float test1(int cond, float a, float b)
4{
5 return cond ? a : b;
6}
Chris Lattner4b009652007-07-25 00:24:17 +00007double test2(int cond, float a, double b)
8{
9 return cond ? a : b;
10}
Chris Lattner307da022007-11-30 17:56:23 +000011
12void f();
13
14void test3(){
15 1 ? f() : (void)0;
16}
17
Eli Friedman33284862008-01-30 17:02:03 +000018void test4() {
19int i; short j;
20float* k = 1 ? &i : &j;
21}