Files
llvm-project/clang/test/CodeGenCXX/pfp-member-pointer-offsetof.cpp
Timm Baeder 198f85ea7c [clang][bytecode] Fix newly added pfp test (#184137)
Do the same thing 370d7ce580 did in
ExprConstant.cpp
2026-03-03 04:54:46 +01:00

16 lines
691 B
C++

// 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)
// CHECK: @__pfp_ds__ZTS1S.ptr2 = hidden alias i8, inttoptr (i64 3573751839 to ptr)
struct [[clang::pointer_field_protection]] S {
int *ptr1;
int *ptr2;
};
void f() {
&S::ptr1;
__builtin_offsetof(S, ptr2);
}