================
@@ -0,0 +1,67 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c23
-I%S/../../CodeGen/Inputs -fclangir -emit-cir %s -o - | FileCheck %s
+
+#include <stdbit.h>
+
+void test_stdc_trailing_zeros(unsigned long long x) {
+ int cnt = __builtin_stdc_trailing_zeros(x);
+ (void)cnt;
+}
+
+// CHECK-LABEL: test_stdc_trailing_zeros
+// CHECK: cir.ctz
+// CHECK-NOT: poison_zero
+// CHECK: cir.return
+
+unsigned test_stdc_leading_zeros(unsigned x) {
+ return __builtin_stdc_leading_zeros(x);
+}
+
+// CHECK-LABEL: test_stdc_leading_zeros
----------------
bcardosolopes wrote:
`test_stdc_leading_zeros` is a prefix of `test_stdc_leading_zeros_ui` below.
Works today by ordering, breaks as soon as someone reorders the file. Anchor on
`@test_stdc_leading_zeros(`.
https://github.com/llvm/llvm-project/pull/214931
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits