Skip to content

Commit 1fdd2f2

Browse files
committed
add egpr restric to the new option.
1 parent 9f43b45 commit 1fdd2f2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clang/lib/Basic/Targets/X86.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
976976
// Condition here is aligned with the feature set of mapxf in Options.td
977977
if (HasEGPR && HasPush2Pop2 && HasPPX && HasNDD)
978978
Builder.defineMacro("__APX_F__");
979-
if (HasInlineAsmUseGPR32)
979+
if (HasEGPR && HasInlineAsmUseGPR32)
980980
Builder.defineMacro("__APX_INLINE_ASM_USE_GPR32__");
981981

982982
// Each case falls through to the previous one here.

clang/test/Preprocessor/x86_target_features.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,5 +812,7 @@
812812
// PPX: #define __PPX__ 1
813813
// PUSH2POP2: #define __PUSH2POP2__ 1
814814

815-
// RUN: %clang -target x86_64-unknown-unknown -march=x86-64 -mapx-inline-asm-use-gpr32 -x c -E -dM -o - %s | FileCheck --check-prefixes=USEGPR32 %s
815+
// RUN: %clang -target x86_64-unknown-unknown -march=x86-64 -mapx-inline-asm-use-gpr32 -x c -E -dM -o - %s | FileCheck --check-prefixes=NOUSEGPR32 %s
816+
// RUN: %clang -target x86_64-unknown-unknown -march=x86-64 -mapx-features=egpr -mapx-inline-asm-use-gpr32 -x c -E -dM -o - %s | FileCheck --check-prefixes=USEGPR32 %s
817+
// NOUSEGPR32-NOT: #define __APX_INLINE_ASM_USE_GPR32__ 1
816818
// USEGPR32: #define __APX_INLINE_ASM_USE_GPR32__ 1

0 commit comments

Comments
 (0)