| 1 |
// RUN: %clang_cc1 -emit-llvm %s -o %t |
| 2 |
// PR1824 |
| 3 |
|
| 4 |
int foo(int x, short y) { |
| 5 |
return x ?: y; |
| 6 |
} |
| 7 |
|
| 8 |
float test(float x, int Y) { |
| 9 |
return Y != 0 ? : x; |
| 10 |
} |
| 11 |
|
| 12 |
extern void abort(void); |
| 13 |
void test1 (void) { |
| 14 |
char x[1]; |
| 15 |
char *y = x ? : 0; |
| 16 |
|
| 17 |
if (x != y) |
| 18 |
abort(); |
| 19 |
} |
| 20 |
|
| 21 |
_Complex int getComplex(_Complex int val) { |
| 22 |
static int count; |
| 23 |
if (count++) |
| 24 |
abort(); |
| 25 |
return val; |
| 26 |
} |
| 27 |
|
| 28 |
_Complex int complx(void) { |
| 29 |
_Complex int cond; |
| 30 |
_Complex int rhs; |
| 31 |
|
| 32 |
return getComplex(1+2i) ? : rhs; |
| 33 |
} |