[clang] [CIR] Upstream support for references (PR #138001)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 30 10:55:42 PDT 2025
================
@@ -102,3 +102,20 @@ size_type max_size() {
// CHECK: %3 = cir.cast(integral, %2 : !s32i), !u64i
// CHECK: %4 = cir.const #cir.int<8> : !u64i
// CHECK: %5 = cir.binop(div, %3, %4) : !u64i
+
+void ref_arg(int &x) {
+ int y = x;
+ x = 3;
+}
----------------
erichkeane wrote:
Can we also have tests for 'function that returns reference'?
```
ClassTy &foo();
ClassTy &&foo();
```
And perhaps `int &z = x`?
https://github.com/llvm/llvm-project/pull/138001
More information about the cfe-commits
mailing list