Skip to content

Commit 9915e98

Browse files
Ensure that IsSupported being false disables the tracked hierachy in our tests (#88848)
1 parent 5a43a6f commit 9915e98

File tree

2 files changed

+2
-2
lines changed
  • src/tests
    • JIT/HardwareIntrinsics/X86/X86Base
    • readytorun/HardwareIntrinsics/X86

2 files changed

+2
-2
lines changed

src/tests/JIT/HardwareIntrinsics/X86/X86Base/CpuId.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ public unsafe static void CpuId()
373373
static bool IsBitIncorrect(int register, int bitNumber, Type isa, bool isSupported, string name, ref bool isHierarchyDisabled)
374374
{
375375
bool isSupportedByHardware = (register & (1 << bitNumber)) != 0;
376-
isHierarchyDisabled |= !GetDotnetEnable(name);
376+
isHierarchyDisabled |= (!isSupported || !GetDotnetEnable(name));
377377

378378
if (isSupported)
379379
{

src/tests/readytorun/HardwareIntrinsics/X86/CpuId.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public unsafe static int Main()
366366
static bool IsBitIncorrect(int register, int bitNumber, Type isa, bool isSupported, string name, ref bool isHierarchyDisabled)
367367
{
368368
bool isSupportedByHardware = (register & (1 << bitNumber)) != 0;
369-
isHierarchyDisabled |= !GetDotnetEnable(name);
369+
isHierarchyDisabled |= (!isSupported || !GetDotnetEnable(name));
370370

371371
if (isSupported)
372372
{

0 commit comments

Comments
 (0)