2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -o %t
|
2007-07-14 04:18:44 +08:00
|
|
|
|
2009-09-09 23:08:12 +08:00
|
|
|
float test1(int cond, float a, float b) {
|
2007-07-14 04:18:44 +08:00
|
|
|
return cond ? a : b;
|
|
|
|
}
|
2009-09-09 23:08:12 +08:00
|
|
|
|
|
|
|
double test2(int cond, float a, double b) {
|
2007-07-14 04:18:44 +08:00
|
|
|
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() {
|
2009-09-09 23:08:12 +08:00
|
|
|
int i; short j;
|
|
|
|
float* k = 1 ? &i : &j;
|
2008-01-31 01:02:03 +08:00
|
|
|
}
|
2008-02-11 07:18:23 +08:00
|
|
|
|
|
|
|
void test5() {
|
|
|
|
const int* cip;
|
|
|
|
void* vp;
|
|
|
|
cip = 0 ? vp : cip;
|
|
|
|
}
|
2008-05-17 01:37:11 +08:00
|
|
|
|
|
|
|
void test6();
|
|
|
|
void test7(int);
|
|
|
|
void* test8() {return 1 ? test6 : test7;}
|
|
|
|
|
2008-06-05 03:15:45 +08:00
|
|
|
|
|
|
|
void _efree(void *ptr);
|
|
|
|
|
2009-09-09 23:08:12 +08:00
|
|
|
void _php_stream_free3() {
|
|
|
|
(1 ? free(0) : _efree(0));
|
2008-06-05 03:15:45 +08:00
|
|
|
}
|
|
|
|
|
2009-09-09 23:08:12 +08:00
|
|
|
void _php_stream_free4() {
|
|
|
|
1 ? _efree(0) : free(0);
|
2008-06-05 03:15:45 +08:00
|
|
|
}
|
2009-11-17 09:22:05 +08:00
|
|
|
|
|
|
|
// PR5526
|
|
|
|
struct test9 { int a; };
|
|
|
|
void* test9spare();
|
|
|
|
void test9(struct test9 *p) {
|
|
|
|
p ? p : test9spare();
|
|
|
|
}
|
|
|
|
|