[Clang][BPF] Add __BPF_FEATURE_GOTOX (#165456)

Add a macro __BPF_FEATURE_GOTOX for bpf target for cpu v4. So the
developer can easily detect whether insn gotox is supported or not.
This commit is contained in:
yonghong-song
2025-10-28 15:20:36 -07:00
committed by GitHub
parent 5defeedd35
commit 2aecb3cc58
2 changed files with 5 additions and 0 deletions

View File

@@ -75,6 +75,7 @@ void BPFTargetInfo::getTargetDefines(const LangOptions &Opts,
Builder.defineMacro("__BPF_FEATURE_GOTOL");
Builder.defineMacro("__BPF_FEATURE_ST");
Builder.defineMacro("__BPF_FEATURE_LOAD_ACQ_STORE_REL");
Builder.defineMacro("__BPF_FEATURE_GOTOX");
}
}

View File

@@ -70,6 +70,9 @@ int u;
#ifdef __BPF_FEATURE_LOAD_ACQ_STORE_REL
int v;
#endif
#ifdef __BPF_FEATURE_GOTOX
int w;
#endif
// CHECK: int b;
// CHECK: int c;
@@ -110,6 +113,7 @@ int v;
// CPU_V4: int u;
// CPU_V4: int v;
// CPU_V4: int w;
// CPU_GENERIC: int g;