================
@@ -1831,6 +1831,22 @@ TEST_P(AArch64ExtensionDependenciesBaseCPUTestFixture,
}
}
+TEST(TargetParserTest, testAArch64ReconstructFromParsedFeatures) {
+ AArch64::ExtensionSet Extensions;
+ std::vector<std::string> FeatureOptions = {
+ "-sve2", "-Baz", "+sve", "+FooBar", "+sve2", "+neon", "-sve",
+ };
+ std::vector<std::string> NonExtensions;
+ Extensions.reconstructFromParsedFeatures(FeatureOptions, NonExtensions);
+
+ std::vector<std::string> NonExtensionsExpected = {"-Baz", "+FooBar"};
+ ASSERT_THAT(NonExtensions, testing::ContainerEq(NonExtensionsExpected));
+ std::vector<StringRef> Features;
+ Extensions.toLLVMFeatureList(Features);
+ std::vector<StringRef> FeaturesExpected = {"+neon", "-sve", "+sve2"};
----------------
labrinea wrote:
> If you look at the code it does Enabled.reset which should remove a feature
> and its dependencies.
Actually I was mistaken, `Enabled.reset` should not transitively remove
dependencies. Calling`disable()` would do that, but as I said this is probably
redundant since the command line arguments have been processed at this stage.
This code inside `reconstructFromParsedFeatures` seems dead
```
if (IsNegated)
Enabled.reset(AE->ID);
```
https://github.com/llvm/llvm-project/pull/142236
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits