brintos

brintos / llvm-project-archived public Read only

0
0
Text · 613 B · 35ffcbc Raw
22 lines · cpp
1// RUN: %clang_cc1 -verify=ref,both %s -fms-extensions -fcxx-exceptions2// RUN: %clang_cc1 -verify=expected,both %s -fexperimental-new-constant-interpreter -fms-extensions -fcxx-exceptions3 4// ref-no-diagnostics5// expected-no-diagnostics6 7/// Used to assert because the two parameters to _rotl do not have the same type.8static_assert(_rotl(0x01, 5) == 32);9 10static_assert(alignof(__unaligned int) == 1, "");11 12static_assert(__noop() == 0, "");13 14constexpr int noopIsActuallyNoop() {15    int a = 0;16    __noop(throw);17    __noop(++a);18    __noop(a = 100);19    return a;20}21static_assert(noopIsActuallyNoop() == 0);22