[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / AST / ByteCode / complex.c
bloba39f83160ef8ca449b0d0931fe6825c4294ccaba
1 // RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=expected,both -Wno-unused-value %s
2 // RUN: %clang_cc1 -verify=ref,both -Wno-unused-value %s
4 void blah() {
5 __complex__ unsigned xx;
6 __complex__ signed yy;
7 __complex__ int result;
9 /// The following line calls into the constant interpreter.
10 result = xx * yy;
14 _Static_assert((0.0 + 0.0j) == (0.0 + 0.0j), "");
15 _Static_assert((0.0 + 0.0j) != (0.0 + 0.0j), ""); // both-error {{static assertion}} \
16 // both-note {{evaluates to}}
18 const _Complex float FC = {0.0f, 0.0f};
19 _Static_assert(!FC, "");
20 const _Complex float FI = {0, 0};
21 _Static_assert(!FI, "");
24 /// Make sure we're stripping the _Atomic part from the
25 /// complex type.
26 void testComplexFloat(_Atomic(_Complex float) *fp) {
27 _Atomic(_Complex float) x = 2.0f;
28 _Complex float f = *fp;
29 *fp = f;