From 95aab7d68723b9aed4d8fc36e4c4e6d5042ae56e Mon Sep 17 00:00:00 2001 From: herman ten brugge Date: Sat, 18 Mar 2023 14:02:52 +0100 Subject: [PATCH] tests/tcctest.c: Add support for osx with clang 10 --- tests/tcctest.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/tcctest.c b/tests/tcctest.c index 6ae5a773..a982aba6 100644 --- a/tests/tcctest.c +++ b/tests/tcctest.c @@ -3875,9 +3875,12 @@ static void builtin_test_bits(unsigned long long x, int cnt[]) if ((unsigned long) x) cnt[7] += __builtin_ctzl(x); if ((unsigned long long) x) cnt[8] += __builtin_ctzll(x); +#if CC_NAME != CC_clang || GCC_MAJOR >= 11 +/* Apple clang 10 does not have __builtin_clrsb[l[l]] */ cnt[9] += __builtin_clrsb(x); cnt[10] += __builtin_clrsbl(x); cnt[11] += __builtin_clrsbll(x); +#endif cnt[12] += __builtin_popcount(x); cnt[13] += __builtin_popcountl(x);