[clang] [CIR] Lowering __builtin_stdc_* calls (PR #214931)
Bruno Cardoso Lopes via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 10 12:46:22 PDT 2026
================
@@ -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
----------------
bcardosolopes wrote:
One RUN line. Convention in this directory is CIR + LLVM + OGCG with prefixes, see builtin-bit.cpp right next door, which is the existing clz/ctz/popcount file. For these builtins the interesting part is the sub and the cast, not that `cir.clz` got emitted, and the OGCG half would have caught the bit_width bug for free.
Nothing else under clang/test/CIR reaches into clang/test/CodeGen/Inputs. Put a stdbit.h in a local Inputs/ instead. The `__builtin_stdc_*` cases need no header at all, OG splits those out under `-ffreestanding` and only pulls in `-isystem %S/Inputs` for the library spellings (clang/test/CodeGen/builtin-stdc-bit-functions.c).
https://github.com/llvm/llvm-project/pull/214931
More information about the cfe-commits
mailing list