[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Sema / constant-builtins-all-args-evaluated.cpp
blobdb55e24cecda7a4c2704827c17421fdb3be9fedb
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // expected-no-diagnostics
4 constexpr int test_clzg_0() {
5 int x = 0;
6 (void)__builtin_clzg(0U, ++x);
7 return x;
10 static_assert(test_clzg_0() == 1);
12 constexpr int test_clzg_1() {
13 int x = 0;
14 (void)__builtin_clzg(1U, ++x);
15 return x;
18 static_assert(test_clzg_1() == 1);
20 constexpr int test_ctzg_0() {
21 int x = 0;
22 (void)__builtin_ctzg(0U, ++x);
23 return x;
26 static_assert(test_ctzg_0() == 1);
28 constexpr int test_ctzg_1() {
29 int x = 0;
30 (void)__builtin_ctzg(1U, ++x);
31 return x;
34 static_assert(test_ctzg_1() == 1);