hanchenye-llvm-project/clang/test/CodeGen/complex.c

49 lines
606 B
C
Raw Normal View History

// RUN: clang -emit-llvm %s
int main(void)
{
double _Complex a = 5;
double _Complex b = 42;
return a * b != b * a;
}
2007-08-11 01:02:59 +08:00
_Complex double bar(int);
void test(_Complex double*);
2007-08-24 07:49:47 +08:00
void takecomplex(_Complex double);
2007-08-11 01:02:59 +08:00
void test2(int c) {
_Complex double X;
X = bar(1);
test(&X);
2007-08-24 07:49:47 +08:00
takecomplex(X);
2007-08-11 01:02:59 +08:00
}
2007-08-24 07:49:47 +08:00
_Complex double g1, g2;
2007-08-27 06:41:57 +08:00
_Complex float cf;
double D;
2007-08-24 07:49:47 +08:00
void test3() {
g1 = g1 + g2;
g1 = g1 - g2;
g1 = g1 * g2;
g1 = +-~g1;
double Gr = __real g1;
2007-08-27 06:41:57 +08:00
cf += D;
2007-08-27 06:41:57 +08:00
D += cf;
cf /= g1;
g1 = g1 + D;
g1 = D + g1;
2007-08-24 07:49:47 +08:00
}
void t1() {
(__real__ cf) = 4.0;
}
void t2() {
(__imag__ cf) = 4.0;
}