2007-07-14 04:18:44 +08:00
|
|
|
// RUN: clang -emit-llvm %s
|
|
|
|
|
|
|
|
float test1(int cond, float a, float b)
|
|
|
|
{
|
|
|
|
return cond ? a : b;
|
|
|
|
}
|
|
|
|
double test2(int cond, float a, double b)
|
|
|
|
{
|
|
|
|
return cond ? a : b;
|
|
|
|
}
|
2007-12-01 01:56:23 +08:00
|
|
|
|
|
|
|
void f();
|
|
|
|
|
|
|
|
void test3(){
|
|
|
|
1 ? f() : (void)0;
|
|
|
|
}
|
|
|
|
|
2008-01-31 01:02:03 +08:00
|
|
|
void test4() {
|
|
|
|
int i; short j;
|
|
|
|
float* k = 1 ? &i : &j;
|
|
|
|
}
|
2008-02-11 07:18:23 +08:00
|
|
|
|
|
|
|
void test5() {
|
|
|
|
const int* cip;
|
|
|
|
void* vp;
|
|
|
|
cip = 0 ? vp : cip;
|
|
|
|
}
|