brintos

brintos / llvm-project-archived public Read only

0
0
Text · 579 B · db55e24 Raw
35 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// expected-no-diagnostics3 4constexpr int test_clzg_0() {5  int x = 0;6  (void)__builtin_clzg(0U, ++x);7  return x;8}9 10static_assert(test_clzg_0() == 1);11 12constexpr int test_clzg_1() {13  int x = 0;14  (void)__builtin_clzg(1U, ++x);15  return x;16}17 18static_assert(test_clzg_1() == 1);19 20constexpr int test_ctzg_0() {21  int x = 0;22  (void)__builtin_ctzg(0U, ++x);23  return x;24}25 26static_assert(test_ctzg_0() == 1);27 28constexpr int test_ctzg_1() {29  int x = 0;30  (void)__builtin_ctzg(1U, ++x);31  return x;32}33 34static_assert(test_ctzg_1() == 1);35