[clang] [clang][bytecode] Attach block scope variables to the root scope (PR #183279)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 25 10:53:47 PST 2026


================
@@ -1,5 +1,23 @@
-// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -fcxx-exceptions -o - %s                                         | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -fcxx-exceptions -o - %s -fexperimental-new-constant-interpreter | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -fcxx-exceptions -o - %s                                                  | FileCheck %s --check-prefix=CHECK
+// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -fcxx-exceptions -o - %s -fexperimental-new-constant-interpreter -DINTERP | FileCheck %s --check-prefix=CHECK,INTERP
+
+/// CodeGenFunction::ConstantFoldsToSimpleInteger() for the if condition
+/// needs to succeed and return true.
+extern void abort2();
+constexpr const int* to_address(const int *p) {
+  return p;
+}
+void rightscope() {
----------------
shafik wrote:

Can you add comments to this test, relates to the change, something like "p should be attached to the rightscope block scope and we can see this in the codegen by ...." 

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


More information about the cfe-commits mailing list