brintos

brintos / llvm-project-archived public Read only

0
0
Text · 885 B · a39f831 Raw
31 lines · c
1// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=expected,both -Wno-unused-value %s2// RUN: %clang_cc1 -verify=ref,both -Wno-unused-value %s3 4void blah() {5  __complex__ unsigned xx;6  __complex__ signed yy;7  __complex__ int result;8 9  /// The following line calls into the constant interpreter.10  result = xx * yy;11}12 13 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}}17 18const _Complex float FC = {0.0f, 0.0f};19_Static_assert(!FC, "");20const _Complex float FI = {0, 0};21_Static_assert(!FI, "");22 23 24/// Make sure we're stripping the _Atomic part from the25/// complex type.26void testComplexFloat(_Atomic(_Complex float) *fp) {27  _Atomic(_Complex float) x = 2.0f;28  _Complex float f = *fp;29  *fp = f;30}31