[clang] [CIR] Lowering __builtin_stdc_* calls (PR #214931)

via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 11 14:52:32 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 92762 tests passed
* 818 tests skipped
* 2 tests failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -ffreestanding -triple x86_64-unknown-linux-gnu -std=c23 -fclangir -emit-cir -verify /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c -o -
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -ffreestanding -triple x86_64-unknown-linux-gnu -std=c23 -fclangir -emit-cir -verify /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c -o -
# .---command stdout------------
# | !u32i = !cir.int<u, 32>
# | !u64i = !cir.int<u, 64>
# | #loc3 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":10:42)
# | #loc4 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":10:55)
# | #loc5 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":11:42)
# | #loc6 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":11:63)
# | #loc19 = loc(fused[#loc3, #loc4])
# | #loc20 = loc(fused[#loc5, #loc6])
# | module @"/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c" attributes {cir.lang = #cir.lang<c>, cir.triple = "x86_64-unknown-linux-gnu", dlti.dl_spec = #dlti.dl_spec<!llvm.ptr<270> = dense<32> : vector<4xi64>, !llvm.ptr<271> = dense<32> : vector<4xi64>, !llvm.ptr<272> = dense<64> : vector<4xi64>, i64 = dense<64> : vector<2xi64>, i128 = dense<128> : vector<2xi64>, f80 = dense<128> : vector<2xi64>, !llvm.ptr = dense<64> : vector<4xi64>, i1 = dense<8> : vector<2xi64>, i8 = dense<8> : vector<2xi64>, i16 = dense<16> : vector<2xi64>, i32 = dense<32> : vector<2xi64>, f16 = dense<16> : vector<2xi64>, f64 = dense<64> : vector<2xi64>, f128 = dense<128> : vector<2xi64>, "dlti.endianness" = "little", "dlti.mangling_mode" = "e", "dlti.legal_int_widths" = array<i32: 8, 16, 32, 64>, "dlti.stack_alignment" = 128 : i64, !cir.ptr<!cir.void> = #cir.ptr_spec<size = 64, abi = 64, preferred = 64, index = 64>>} {
# |   cir.func no_inline dso_local @test_unimplemented_builtin_stdc_bit(%arg0: !u32i {llvm.noundef} loc(fused[#loc3, #loc4]), %arg1: !u64i loc(fused[#loc5, #loc6])) attributes {"cir.target-features" = "+cx8,+mmx,+sse,+sse2,+x87", nobuiltins = [], nothrow} {
# |     %0 = cir.alloca "coerce" align(8) : !cir.ptr<!u64i> loc(#loc18)
# |     cir.store %arg1, %0 : !u64i, !cir.ptr<!u64i> loc(#loc18)
# |     %1 = cir.cast bitcast %0 : !cir.ptr<!u64i> -> !cir.ptr<!cir.int<u, 37, bitint>> loc(#loc18)
# |     %2 = cir.load %1 : !cir.ptr<!cir.int<u, 37, bitint>>, !cir.int<u, 37, bitint> loc(#loc18)
# |     %3 = cir.alloca "ui" align(4) init : !cir.ptr<!u32i> loc(#loc19)
# |     %4 = cir.alloca "bi" align(8) init : !cir.ptr<!cir.int<u, 37, bitint>> loc(#loc20)
# |     %5 = cir.alloca "r" align(4) : !cir.ptr<!u32i> loc(#loc21)
# |     cir.store %arg0, %3 : !u32i, !cir.ptr<!u32i> loc(#loc9)
# |     cir.store %2, %4 : !cir.int<u, 37, bitint>, !cir.ptr<!cir.int<u, 37, bitint>> loc(#loc9)
# |     %6 = cir.const #cir.undef : !u32i loc(#loc10)
# |     cir.store volatile align(4) %6, %5 : !u32i, !cir.ptr<!u32i> loc(#loc22)
# |     %7 = cir.const #cir.undef : !u32i loc(#loc10)
# |     cir.store volatile align(4) %7, %5 : !u32i, !cir.ptr<!u32i> loc(#loc23)
# |     %8 = cir.load align(8) %4 : !cir.ptr<!cir.int<u, 37, bitint>>, !cir.int<u, 37, bitint> loc(#loc15)
# |     %9 = cir.load align(8) %4 : !cir.ptr<!cir.int<u, 37, bitint>>, !cir.int<u, 37, bitint> loc(#loc16)
# |     %10 = cir.load align(8) %4 : !cir.ptr<!cir.int<u, 37, bitint>>, !cir.int<u, 37, bitint> loc(#loc17)
# |     cir.return loc(#loc2)
# |   } loc(#loc18)
# | } loc(#loc)
# | #loc = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":0:0)
# | #loc1 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":10:1)
# | #loc2 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":18:1)
# | #loc7 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":12:3)
# | #loc8 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":12:25)
# | #loc9 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":11:67)
# | #loc10 = loc(unknown)
# | #loc11 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":13:3)
# | #loc12 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":13:33)
# | #loc13 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":14:3)
# | #loc14 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":14:34)
# | #loc15 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":15:38)
# | #loc16 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":16:36)
# | #loc17 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":17:39)
# | #loc18 = loc(fused[#loc1, #loc2])
# | #loc21 = loc(fused[#loc7, #loc8])
# | #loc22 = loc(fused[#loc11, #loc12])
# | #loc23 = loc(fused[#loc13, #loc14])
# `-----------------------------
# .---command stderr------------
# | error: 'expected-error' diagnostics expected but not seen: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c Line 15: ClangIR code gen Not Yet Implemented: stdc bit builtin on unsupported integer width
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c Line 16: ClangIR code gen Not Yet Implemented: stdc bit builtin on unsupported integer width
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c Line 17: ClangIR code gen Not Yet Implemented: stdc bit builtin on unsupported integer width
# | error: 'expected-error' diagnostics seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c Line 15: ClangIR code gen Not Yet Implemented: stdc bit builtin with unsupported argument integer width
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c Line 16: ClangIR code gen Not Yet Implemented: stdc bit builtin with unsupported argument integer width
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c Line 17: ClangIR code gen Not Yet Implemented: stdc bit builtin with unsupported argument integer width
# | 6 errors generated.
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Clang.CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -ffreestanding -triple x86_64-unknown-linux-gnu -std=c23 -fclangir -emit-cir -verify /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c -o -
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -ffreestanding -triple x86_64-unknown-linux-gnu -std=c23 -fclangir -emit-cir -verify /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c -o -
# .---command stdout------------
# | !u32i = !cir.int<u, 32>
# | !u64i = !cir.int<u, 64>
# | #loc3 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":10:42)
# | #loc4 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":10:55)
# | #loc5 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":11:42)
# | #loc6 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":11:63)
# | #loc19 = loc(fused[#loc3, #loc4])
# | #loc20 = loc(fused[#loc5, #loc6])
# | module @"/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c" attributes {cir.lang = #cir.lang<c>, cir.triple = "x86_64-unknown-linux-gnu", dlti.dl_spec = #dlti.dl_spec<!llvm.ptr<270> = dense<32> : vector<4xi64>, !llvm.ptr<271> = dense<32> : vector<4xi64>, !llvm.ptr<272> = dense<64> : vector<4xi64>, i64 = dense<64> : vector<2xi64>, i128 = dense<128> : vector<2xi64>, f80 = dense<128> : vector<2xi64>, !llvm.ptr = dense<64> : vector<4xi64>, i1 = dense<8> : vector<2xi64>, i8 = dense<8> : vector<2xi64>, i16 = dense<16> : vector<2xi64>, i32 = dense<32> : vector<2xi64>, f16 = dense<16> : vector<2xi64>, f64 = dense<64> : vector<2xi64>, f128 = dense<128> : vector<2xi64>, "dlti.endianness" = "little", "dlti.mangling_mode" = "e", "dlti.legal_int_widths" = array<i32: 8, 16, 32, 64>, "dlti.stack_alignment" = 128 : i64, !cir.ptr<!cir.void> = #cir.ptr_spec<size = 64, abi = 64, preferred = 64, index = 64>>} {
# |   cir.func no_inline dso_local @test_unimplemented_builtin_stdc_bit(%arg0: !u32i {llvm.noundef} loc(fused[#loc3, #loc4]), %arg1: !u64i loc(fused[#loc5, #loc6])) attributes {"cir.target-features" = "+cx8,+mmx,+sse,+sse2,+x87", nobuiltins = [], nothrow} {
# |     %0 = cir.alloca "coerce" align(8) : !cir.ptr<!u64i> loc(#loc18)
# |     cir.store %arg1, %0 : !u64i, !cir.ptr<!u64i> loc(#loc18)
# |     %1 = cir.cast bitcast %0 : !cir.ptr<!u64i> -> !cir.ptr<!cir.int<u, 37, bitint>> loc(#loc18)
# |     %2 = cir.load %1 : !cir.ptr<!cir.int<u, 37, bitint>>, !cir.int<u, 37, bitint> loc(#loc18)
# |     %3 = cir.alloca "ui" align(4) init : !cir.ptr<!u32i> loc(#loc19)
# |     %4 = cir.alloca "bi" align(8) init : !cir.ptr<!cir.int<u, 37, bitint>> loc(#loc20)
# |     %5 = cir.alloca "r" align(4) : !cir.ptr<!u32i> loc(#loc21)
# |     cir.store %arg0, %3 : !u32i, !cir.ptr<!u32i> loc(#loc9)
# |     cir.store %2, %4 : !cir.int<u, 37, bitint>, !cir.ptr<!cir.int<u, 37, bitint>> loc(#loc9)
# |     %6 = cir.const #cir.undef : !u32i loc(#loc10)
# |     cir.store volatile align(4) %6, %5 : !u32i, !cir.ptr<!u32i> loc(#loc22)
# |     %7 = cir.const #cir.undef : !u32i loc(#loc10)
# |     cir.store volatile align(4) %7, %5 : !u32i, !cir.ptr<!u32i> loc(#loc23)
# |     %8 = cir.load align(8) %4 : !cir.ptr<!cir.int<u, 37, bitint>>, !cir.int<u, 37, bitint> loc(#loc15)
# |     %9 = cir.load align(8) %4 : !cir.ptr<!cir.int<u, 37, bitint>>, !cir.int<u, 37, bitint> loc(#loc16)
# |     %10 = cir.load align(8) %4 : !cir.ptr<!cir.int<u, 37, bitint>>, !cir.int<u, 37, bitint> loc(#loc17)
# |     cir.return loc(#loc2)
# |   } loc(#loc18)
# | } loc(#loc)
# | #loc = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":0:0)
# | #loc1 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":10:1)
# | #loc2 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":18:1)
# | #loc7 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":12:3)
# | #loc8 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":12:25)
# | #loc9 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":11:67)
# | #loc10 = loc(unknown)
# | #loc11 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":13:3)
# | #loc12 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":13:33)
# | #loc13 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":14:3)
# | #loc14 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":14:34)
# | #loc15 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":15:38)
# | #loc16 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":16:36)
# | #loc17 = loc("/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c":17:39)
# | #loc18 = loc(fused[#loc1, #loc2])
# | #loc21 = loc(fused[#loc7, #loc8])
# | #loc22 = loc(fused[#loc11, #loc12])
# | #loc23 = loc(fused[#loc13, #loc14])
# `-----------------------------
# .---command stderr------------
# | error: 'expected-error' diagnostics expected but not seen: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c Line 15: ClangIR code gen Not Yet Implemented: stdc bit builtin on unsupported integer width
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c Line 16: ClangIR code gen Not Yet Implemented: stdc bit builtin on unsupported integer width
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c Line 17: ClangIR code gen Not Yet Implemented: stdc bit builtin on unsupported integer width
# | error: 'expected-error' diagnostics seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c Line 15: ClangIR code gen Not Yet Implemented: stdc bit builtin with unsupported argument integer width
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c Line 16: ClangIR code gen Not Yet Implemented: stdc bit builtin with unsupported argument integer width
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGenBuiltins/builtin-stdc-bit-nyi.c Line 17: ClangIR code gen Not Yet Implemented: stdc bit builtin with unsupported argument integer width
# | 6 errors generated.
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/214931


More information about the cfe-commits mailing list