[Clang][NFC] Added testcase from #49549

The issue is fixed in trunk, so add testcase to avoid regression in the future.
This commit is contained in:
Dávid Bolvanský 2022-01-31 23:45:56 +01:00
parent 85dae4c11e
commit 623b66eded

View File

@ -159,4 +159,18 @@ constexpr int constexpr_function() {
[[likely]] return 0;
}
static_assert(constexpr_function() == 0);
constexpr double pow(double x, long long n) noexcept {
if (n > 0) [[likely]]
return x * pow(x, n - 1);
else [[unlikely]]
return 1;
}
constexpr long long fact(long long n) noexcept {
if (n > 1) [[likely]]
return n * fact(n - 1);
else [[unlikely]]
return 1;
}
#endif