[clang] [CIR] Support pointer-to-data-member binary operators for aggregates (PR #221784)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 12 13:11:45 PDT 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results
* 63553 tests passed
* 819 tests skipped
* 2 tests failed
## Failed Tests
(click on a test name to see its output)
### Clang
<details>
<summary>Clang.CIR/CodeGen/pointer-to-data-member.cpp</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 -triple x86_64-unknown-linux-gnu -std=c++17 -fclangir -Wno-unused-value -emit-cir -mmlir -mlir-print-ir-before=cir-cxxabi-lowering /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp.cir 2> /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir
# 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 -triple x86_64-unknown-linux-gnu -std=c++17 -fclangir -Wno-unused-value -emit-cir -mmlir -mlir-print-ir-before=cir-cxxabi-lowering /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp.cir
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=CIR-BEFORE --input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=CIR-BEFORE --input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp:508:16: error: CIR-BEFORE: expected string not found in input
# | // CIR-BEFORE: cir.copy %[[RT_MEMBER]] to %[[RETVAL_ADDR]] : !cir.ptr<!rec_Inner>
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:133:128: note: scanning from here
# | %5 = cir.get_runtime_member %3[%4 : !cir.data_member<!rec_Inner in !rec_Outer>] : !cir.ptr<!rec_Outer> -> !cir.ptr<!rec_Inner>
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:133:128: note: with "RT_MEMBER" equal to "5"
# | %5 = cir.get_runtime_member %3[%4 : !cir.data_member<!rec_Inner in !rec_Outer>] : !cir.ptr<!rec_Outer> -> !cir.ptr<!rec_Inner>
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:133:128: note: with "RETVAL_ADDR" equal to "2"
# | %5 = cir.get_runtime_member %3[%4 : !cir.data_member<!rec_Inner in !rec_Outer>] : !cir.ptr<!rec_Outer> -> !cir.ptr<!rec_Inner>
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:134:30: note: possible intended match here
# | cir.copy %5 align(4) to %2 align(4) : !cir.ptr<!rec_Inner>
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp:556:16: error: CIR-BEFORE: expected string not found in input
# | // CIR-BEFORE: %[[O_ADDR:.*]] = cir.alloca "o" {{.*}} init const : !cir.ptr<!cir.ptr<!rec_Outer>>
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:138:161: note: scanning from here
# | cir.func no_inline dso_local @_Z14test_agg_arrowPK5OuterMS_5Inner(%arg0: !cir.ptr<!rec_Outer> {llvm.noundef}, %arg1: !cir.data_member<!rec_Inner in !rec_Outer>) -> !rec_Inner attributes {"cir.target-features" = "+cx8,+mmx,+sse,+sse2,+x87", nothrow} {
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:138:161: note: pattern attempts to capture variables: "O_ADDR"
# | cir.func no_inline dso_local @_Z14test_agg_arrowPK5OuterMS_5Inner(%arg0: !cir.ptr<!rec_Outer> {llvm.noundef}, %arg1: !cir.data_member<!rec_Inner in !rec_Outer>) -> !rec_Inner attributes {"cir.target-features" = "+cx8,+mmx,+sse,+sse2,+x87", nothrow} {
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:139:2: note: possible intended match here
# | %0 = cir.alloca "o" align(8) init : !cir.ptr<!cir.ptr<!rec_Outer>>
# | ^
# |
# | Input file: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# | .
# | .
# | .
# | 128: %2 = cir.alloca "__retval" align(4) : !cir.ptr<!rec_Inner>
# | 129: cir.store %arg0, %0 : !cir.ptr<!rec_Outer>, !cir.ptr<!cir.ptr<!rec_Outer>>
# | 130: cir.store %arg1, %1 : !cir.data_member<!rec_Inner in !rec_Outer>, !cir.ptr<!cir.data_member<!rec_Inner in !rec_Outer>>
# | 131: %3 = cir.load %0 : !cir.ptr<!cir.ptr<!rec_Outer>>, !cir.ptr<!rec_Outer>
# | 132: %4 = cir.load align(8) %1 : !cir.ptr<!cir.data_member<!rec_Inner in !rec_Outer>>, !cir.data_member<!rec_Inner in !rec_Outer>
# | 133: %5 = cir.get_runtime_member %3[%4 : !cir.data_member<!rec_Inner in !rec_Outer>] : !cir.ptr<!rec_Outer> -> !cir.ptr<!rec_Inner>
# | check:508'0 { search range start (exclusive)
# | check:508'1 error: no match found in search range
# | check:508'2 with "RT_MEMBER" equal to "5"
# | check:508'3 with "RETVAL_ADDR" equal to "2"
# | 134: cir.copy %5 align(4) to %2 align(4) : !cir.ptr<!rec_Inner>
# | check:508'4 ? possible intended match
# | 135: %6 = cir.load %2 : !cir.ptr<!rec_Inner>, !rec_Inner
# | 136: cir.return %6 : !rec_Inner
# | 137: }
# | 138: cir.func no_inline dso_local @_Z14test_agg_arrowPK5OuterMS_5Inner(%arg0: !cir.ptr<!rec_Outer> {llvm.noundef}, %arg1: !cir.data_member<!rec_Inner in !rec_Outer>) -> !rec_Inner attributes {"cir.target-features" = "+cx8,+mmx,+sse,+sse2,+x87", nothrow} {
# | check:508'5 } search range end (exclusive)
# | check:556'0 { search range start (exclusive)
# | check:556'1 error: no match found in search range
# | check:556'2 pattern attempts to capture variables: "O_ADDR"
# | 139: %0 = cir.alloca "o" align(8) init : !cir.ptr<!cir.ptr<!rec_Outer>>
# | check:556'3 ? possible intended match
# | 140: %1 = cir.alloca "p" align(8) init : !cir.ptr<!cir.data_member<!rec_Inner in !rec_Outer>>
# | 141: %2 = cir.alloca "__retval" align(4) : !cir.ptr<!rec_Inner>
# | 142: cir.store %arg0, %0 : !cir.ptr<!rec_Outer>, !cir.ptr<!cir.ptr<!rec_Outer>>
# | 143: cir.store %arg1, %1 : !cir.data_member<!rec_Inner in !rec_Outer>, !cir.ptr<!cir.data_member<!rec_Inner in !rec_Outer>>
# | 144: %3 = cir.load align(8) %0 : !cir.ptr<!cir.ptr<!rec_Outer>>, !cir.ptr<!rec_Outer>
# | 145: %4 = cir.load align(8) %1 : !cir.ptr<!cir.data_member<!rec_Inner in !rec_Outer>>, !cir.data_member<!rec_Inner in !rec_Outer>
# | 146: %5 = cir.get_runtime_member %3[%4 : !cir.data_member<!rec_Inner in !rec_Outer>] : !cir.ptr<!rec_Outer> -> !cir.ptr<!rec_Inner>
# | 147: cir.copy %5 align(4) to %2 align(4) : !cir.ptr<!rec_Inner>
# | 148: %6 = cir.load %2 : !cir.ptr<!rec_Inner>, !rec_Inner
# | 149: cir.return %6 : !rec_Inner
# | 150: }
# | 151: }
# | 152:
# | 153:
# | check:556'4 } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
<details>
<summary>Clang.CIR/CodeGen/pointer-to-data-member.cpp</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 -triple x86_64-unknown-linux-gnu -std=c++17 -fclangir -Wno-unused-value -emit-cir -mmlir -mlir-print-ir-before=cir-cxxabi-lowering /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp.cir 2> /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir
# 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 -triple x86_64-unknown-linux-gnu -std=c++17 -fclangir -Wno-unused-value -emit-cir -mmlir -mlir-print-ir-before=cir-cxxabi-lowering /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp.cir
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=CIR-BEFORE --input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=CIR-BEFORE --input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp:508:16: error: CIR-BEFORE: expected string not found in input
# | // CIR-BEFORE: cir.copy %[[RT_MEMBER]] to %[[RETVAL_ADDR]] : !cir.ptr<!rec_Inner>
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:133:128: note: scanning from here
# | %5 = cir.get_runtime_member %3[%4 : !cir.data_member<!rec_Inner in !rec_Outer>] : !cir.ptr<!rec_Outer> -> !cir.ptr<!rec_Inner>
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:133:128: note: with "RT_MEMBER" equal to "5"
# | %5 = cir.get_runtime_member %3[%4 : !cir.data_member<!rec_Inner in !rec_Outer>] : !cir.ptr<!rec_Outer> -> !cir.ptr<!rec_Inner>
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:133:128: note: with "RETVAL_ADDR" equal to "2"
# | %5 = cir.get_runtime_member %3[%4 : !cir.data_member<!rec_Inner in !rec_Outer>] : !cir.ptr<!rec_Outer> -> !cir.ptr<!rec_Inner>
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:134:30: note: possible intended match here
# | cir.copy %5 align(4) to %2 align(4) : !cir.ptr<!rec_Inner>
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp:556:16: error: CIR-BEFORE: expected string not found in input
# | // CIR-BEFORE: %[[O_ADDR:.*]] = cir.alloca "o" {{.*}} init const : !cir.ptr<!cir.ptr<!rec_Outer>>
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:138:161: note: scanning from here
# | cir.func no_inline dso_local @_Z14test_agg_arrowPK5OuterMS_5Inner(%arg0: !cir.ptr<!rec_Outer> {llvm.noundef}, %arg1: !cir.data_member<!rec_Inner in !rec_Outer>) -> !rec_Inner attributes {"cir.target-features" = "+cx8,+mmx,+sse,+sse2,+x87", nothrow} {
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:138:161: note: pattern attempts to capture variables: "O_ADDR"
# | cir.func no_inline dso_local @_Z14test_agg_arrowPK5OuterMS_5Inner(%arg0: !cir.ptr<!rec_Outer> {llvm.noundef}, %arg1: !cir.data_member<!rec_Inner in !rec_Outer>) -> !rec_Inner attributes {"cir.target-features" = "+cx8,+mmx,+sse,+sse2,+x87", nothrow} {
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir:139:2: note: possible intended match here
# | %0 = cir.alloca "o" align(8) init : !cir.ptr<!cir.ptr<!rec_Outer>>
# | ^
# |
# | Input file: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/pointer-to-data-member.cpp.tmp-before.cir
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/pointer-to-data-member.cpp
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# | .
# | .
# | .
# | 128: %2 = cir.alloca "__retval" align(4) : !cir.ptr<!rec_Inner>
# | 129: cir.store %arg0, %0 : !cir.ptr<!rec_Outer>, !cir.ptr<!cir.ptr<!rec_Outer>>
# | 130: cir.store %arg1, %1 : !cir.data_member<!rec_Inner in !rec_Outer>, !cir.ptr<!cir.data_member<!rec_Inner in !rec_Outer>>
# | 131: %3 = cir.load %0 : !cir.ptr<!cir.ptr<!rec_Outer>>, !cir.ptr<!rec_Outer>
# | 132: %4 = cir.load align(8) %1 : !cir.ptr<!cir.data_member<!rec_Inner in !rec_Outer>>, !cir.data_member<!rec_Inner in !rec_Outer>
# | 133: %5 = cir.get_runtime_member %3[%4 : !cir.data_member<!rec_Inner in !rec_Outer>] : !cir.ptr<!rec_Outer> -> !cir.ptr<!rec_Inner>
# | check:508'0 { search range start (exclusive)
# | check:508'1 error: no match found in search range
# | check:508'2 with "RT_MEMBER" equal to "5"
# | check:508'3 with "RETVAL_ADDR" equal to "2"
# | 134: cir.copy %5 align(4) to %2 align(4) : !cir.ptr<!rec_Inner>
# | check:508'4 ? possible intended match
# | 135: %6 = cir.load %2 : !cir.ptr<!rec_Inner>, !rec_Inner
# | 136: cir.return %6 : !rec_Inner
# | 137: }
# | 138: cir.func no_inline dso_local @_Z14test_agg_arrowPK5OuterMS_5Inner(%arg0: !cir.ptr<!rec_Outer> {llvm.noundef}, %arg1: !cir.data_member<!rec_Inner in !rec_Outer>) -> !rec_Inner attributes {"cir.target-features" = "+cx8,+mmx,+sse,+sse2,+x87", nothrow} {
# | check:508'5 } search range end (exclusive)
# | check:556'0 { search range start (exclusive)
# | check:556'1 error: no match found in search range
# | check:556'2 pattern attempts to capture variables: "O_ADDR"
# | 139: %0 = cir.alloca "o" align(8) init : !cir.ptr<!cir.ptr<!rec_Outer>>
# | check:556'3 ? possible intended match
# | 140: %1 = cir.alloca "p" align(8) init : !cir.ptr<!cir.data_member<!rec_Inner in !rec_Outer>>
# | 141: %2 = cir.alloca "__retval" align(4) : !cir.ptr<!rec_Inner>
# | 142: cir.store %arg0, %0 : !cir.ptr<!rec_Outer>, !cir.ptr<!cir.ptr<!rec_Outer>>
# | 143: cir.store %arg1, %1 : !cir.data_member<!rec_Inner in !rec_Outer>, !cir.ptr<!cir.data_member<!rec_Inner in !rec_Outer>>
# | 144: %3 = cir.load align(8) %0 : !cir.ptr<!cir.ptr<!rec_Outer>>, !cir.ptr<!rec_Outer>
# | 145: %4 = cir.load align(8) %1 : !cir.ptr<!cir.data_member<!rec_Inner in !rec_Outer>>, !cir.data_member<!rec_Inner in !rec_Outer>
# | 146: %5 = cir.get_runtime_member %3[%4 : !cir.data_member<!rec_Inner in !rec_Outer>] : !cir.ptr<!rec_Outer> -> !cir.ptr<!rec_Inner>
# | 147: cir.copy %5 align(4) to %2 align(4) : !cir.ptr<!rec_Inner>
# | 148: %6 = cir.load %2 : !cir.ptr<!rec_Inner>, !rec_Inner
# | 149: cir.return %6 : !rec_Inner
# | 150: }
# | 151: }
# | 152:
# | 153:
# | check:556'4 } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# 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/221784
More information about the cfe-commits
mailing list