diff options
author | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
commit | f27e5a09a0d815b8a4814152954ff87dadfdefc0 (patch) | |
tree | ce7d964cbb5e39695b71481698f10cb099c23d4a /test/CodeGen/complex.c | |
download | FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.zip FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.tar.gz |
Import Clang, at r72732.
Diffstat (limited to 'test/CodeGen/complex.c')
-rw-r--r-- | test/CodeGen/complex.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/test/CodeGen/complex.c b/test/CodeGen/complex.c new file mode 100644 index 0000000..6a0d3d6 --- /dev/null +++ b/test/CodeGen/complex.c @@ -0,0 +1,61 @@ +// RUN: clang-cc -emit-llvm < %s + +int main(void) +{ + double _Complex a = 5; + double _Complex b = 42; + + return a * b != b * a; +} + +_Complex double bar(int); +void test(_Complex double*); +void takecomplex(_Complex double); + +void test2(int c) { + _Complex double X; + X = bar(1); + test(&X); + takecomplex(X); +} + +_Complex double g1, g2; +_Complex float cf; +double D; + +void test3() { + g1 = g1 + g2; + g1 = g1 - g2; + g1 = g1 * g2; + g1 = +-~g1; + + double Gr = __real g1; + + cf += D; + // FIXME: Currently unsupported! + //D += cf; + cf /= g1; + g1 = g1 + D; + g1 = D + g1; +} + +void t1() { + (__real__ cf) = 4.0; +} + +void t2() { + (__imag__ cf) = 4.0; +} + +// PR1960 +void t3() { + __complex__ long long v = 2; +} + +// PR3131 +float _Complex t4(); + +void t5() { + float _Complex x = t4(); +} + |