-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Open
Labels
llvmUmbrella label for LLVM issuesUmbrella label for LLVM issues
Description
Read this code.
Repro steps:
- Create a Triple: "arch-vendor-os-env".
- Call
triple.SetObjectFormat()
to set it to the default format (the one that would be returned bygetDefaultFormat()
). The object format component would be added. - Call
triple.SetEnvironment()
to set the same environment. The object format component would be removed. - One can then repeat step 2 and 3 to add/remove the object format component while it has always been the same object format.
The above can be verified by the following test:
TEST_F(TempTest, TempTest1) {
// Initial triple, without object format component
llvm::Triple triple("arm64-apple-ios-simulator");
ASSERT_EQ(triple.str(), "arm64-apple-ios-simulator");
ASSERT_EQ(triple.getObjectFormat(), llvm::Triple::MachO);
// Explicitly set the same object format.
// This adds the object format component to the triple string.
triple.setObjectFormat(llvm::Triple::MachO);
ASSERT_EQ(triple.str(), "arm64-apple-ios-simulator-macho");
ASSERT_EQ(triple.getObjectFormat(), llvm::Triple::MachO);
// Explicitly set the same environment.
// This removes the object format component from the triple string.
triple.setEnvironmentName("simulator");
ASSERT_EQ(triple.str(), "arm64-apple-ios-simulator");
ASSERT_EQ(triple.getObjectFormat(), llvm::Triple::MachO);
}
Metadata
Metadata
Assignees
Labels
llvmUmbrella label for LLVM issuesUmbrella label for LLVM issues