Author: Timm Baeder
Date: 2026-03-03T04:54:46+01:00
New Revision: 198f85ea7c17141f3cd46d0a69044aea52163677

URL: 
https://github.com/llvm/llvm-project/commit/198f85ea7c17141f3cd46d0a69044aea52163677
DIFF: 
https://github.com/llvm/llvm-project/commit/198f85ea7c17141f3cd46d0a69044aea52163677.diff

LOG: [clang][bytecode] Fix newly added pfp test (#184137)

Do the same thing 370d7ce58011eccfab8105eddbc028cc09c4c5e5 did in
ExprConstant.cpp

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/InterpBuiltin.cpp
    clang/test/CodeGenCXX/pfp-member-pointer-offsetof.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp 
b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index 62cb37f720af2..c7d3c2e500592 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -5971,6 +5971,7 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const 
CallExpr *Call,
 
 bool InterpretOffsetOf(InterpState &S, CodePtr OpPC, const OffsetOfExpr *E,
                        ArrayRef<int64_t> ArrayIndices, int64_t &IntResult) {
+  S.getASTContext().recordOffsetOfEvaluation(E);
   CharUnits Result;
   unsigned N = E->getNumComponents();
   assert(N > 0);

diff  --git a/clang/test/CodeGenCXX/pfp-member-pointer-offsetof.cpp 
b/clang/test/CodeGenCXX/pfp-member-pointer-offsetof.cpp
index 842bdd7e9f83d..d4abf27c01dc4 100644
--- a/clang/test/CodeGenCXX/pfp-member-pointer-offsetof.cpp
+++ b/clang/test/CodeGenCXX/pfp-member-pointer-offsetof.cpp
@@ -1,3 +1,4 @@
+// RUN: %clang_cc1 -triple aarch64-linux-gnu -emit-llvm 
-fexperimental-allow-pointer-field-protection-attr 
-fexperimental-pointer-field-protection-abi -o - %s 
-fexperimental-new-constant-interpreter | FileCheck %s
 // RUN: %clang_cc1 -triple aarch64-linux-gnu -emit-llvm 
-fexperimental-allow-pointer-field-protection-attr 
-fexperimental-pointer-field-protection-abi -o - %s | FileCheck %s
 
 // CHECK: @__pfp_ds__ZTS1S.ptr1 = hidden alias i8, inttoptr (i64 3573751839 to 
ptr)


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to