diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-11-29 19:05:51 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-11-29 19:05:51 +0000 |
commit | 502654085f1529ef034be9ad0fd078d32e47ddfa (patch) | |
tree | fe87a2148d7b73128f6ad07ee19ee6956a41066c | |
parent | 6127b12f1663323490fdbd08bbb73bd14df3e4e8 (diff) |
Added "complex.c" (a copy of test/Codegen/complex.) to the serialization
test suite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44439 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Serialization/complex.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/Serialization/complex.c b/test/Serialization/complex.c new file mode 100644 index 0000000000..f622264842 --- /dev/null +++ b/test/Serialization/complex.c @@ -0,0 +1,48 @@ +// RUN: clang %s --test-pickling 2>&1 | grep -q 'SUCCESS' + +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; + D += cf; + cf /= g1; + g1 = g1 + D; + g1 = D + g1; +} + +void t1() { + (__real__ cf) = 4.0; +} + +void t2() { + (__imag__ cf) = 4.0; +} + |