]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/conditional-gnu-ext.c
Vendor import of clang trunk r126079:
[FreeBSD/FreeBSD.git] / test / CodeGen / conditional-gnu-ext.c
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 // rdar://6586493
9 float test(float x, int Y) {
10   return Y != 0 ? : x;
11 }
12
13 // rdar://8446940
14 extern void abort();
15 void  test1 () {
16   char x[1];
17   char *y = x ? : 0;
18
19   if (x != y)
20     abort();
21 }
22
23 // rdar://8453812
24 _Complex int getComplex(_Complex int val) {
25   static int count;
26   if (count++)
27     abort();
28   return val;
29 }
30
31 _Complex int complx() {
32     _Complex int cond;
33     _Complex int rhs;
34
35     return getComplex(1+2i) ? : rhs;
36 }