diff options
author | Jacob Bramley <jacob.bramley@arm.com> | 2020-07-08 20:53:32 +0100 |
---|---|---|
committer | Jacob Bramley <jacob.bramley@arm.com> | 2020-07-16 09:50:25 +0000 |
commit | 8c4ceb6a3ac0d32dd562998baef0322882d295bd (patch) | |
tree | f54d59169d9686c787228822aa32d04105b3911c /test | |
parent | caa40eec47ba19d132fbabc5dfdc0948bd3689f3 (diff) | |
download | vixl-8c4ceb6a3ac0d32dd562998baef0322882d295bd.tar.gz |
Support more than 64 CPU features.
After recent patches, we have exactly 64 CPU features. This patch makes
the mechanism flexible so that we can support more features in the
future.
Several operators on CPUFeatures had to be re-written as part of this,
so this patch replaces the default-argument implementations with a more
flexible template-based approach, which can accept more than four
features. Existing usage remains unaffected.
Change-Id: If91a3adb62669aa827464e857a90eb93a64db7a6
Diffstat (limited to 'test')
-rw-r--r-- | test/test-api.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/test-api.cc b/test/test-api.cc index 577a8ee2..b30230d6 100644 --- a/test/test-api.cc +++ b/test/test-api.cc @@ -485,7 +485,10 @@ TEST(CPUFeaturesScope) { CPUFeatures auth(CPUFeatures::kPAuth, CPUFeatures::kPAuthQARMA, CPUFeatures::kPAuthGeneric, - CPUFeatures::kPAuthGenericQARMA); + CPUFeatures::kPAuthGenericQARMA, + CPUFeatures::kPAuthEnhancedPAC2, + CPUFeatures::kPAuthFPAC, + CPUFeatures::kPAuthFPACCombined); CPUFeaturesScope inner(&outer, auth); VIXL_CHECK(inner.GetCPUFeatures() == &cpu); @@ -498,6 +501,11 @@ TEST(CPUFeaturesScope) { VIXL_CHECK(original_inner.Has(cpu)); } + { + // Scopes can be initialised with no features. + CPUFeaturesScope scope(&top_level); + } + // Check for equivalence. VIXL_CHECK(cpu.Has(original_outer)); VIXL_CHECK(original_outer.Has(cpu)); |