diff options
author | David Green <david.green@arm.com> | 2019-02-02 08:31:22 +0000 |
---|---|---|
committer | David Green <david.green@arm.com> | 2019-02-02 08:31:22 +0000 |
commit | 1be906a103094c6fc2eea0985ffe3dc9e6de59f9 (patch) | |
tree | d7cb90c3070e618841416d1025e71b73abff65d7 | |
parent | d3107a7b85eb8421d91b93bd67d8f0cf769d978e (diff) | |
download | llvm-1be906a103094c6fc2eea0985ffe3dc9e6de59f9.zip llvm-1be906a103094c6fc2eea0985ffe3dc9e6de59f9.tar.gz llvm-1be906a103094c6fc2eea0985ffe3dc9e6de59f9.tar.bz2 |
[ASTImporter] Fix up test that only works on X86.
The test will fail if the default target triple is not X86,
even if the host platform is. So move the check into the
test at runtime.
llvm-svn: 352956
-rw-r--r-- | clang/unittests/AST/StructuralEquivalenceTest.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/unittests/AST/StructuralEquivalenceTest.cpp b/clang/unittests/AST/StructuralEquivalenceTest.cpp index e6c289a..ae62747 100644 --- a/clang/unittests/AST/StructuralEquivalenceTest.cpp +++ b/clang/unittests/AST/StructuralEquivalenceTest.cpp @@ -378,10 +378,12 @@ TEST_F(StructuralEquivalenceFunctionTest, FunctionsWithDifferentNoreturnAttr) { EXPECT_TRUE(testStructuralMatch(t)); } -// These attributes may not be available on certain platforms. -#if defined(__x86_64__) && defined(__linux__) TEST_F(StructuralEquivalenceFunctionTest, FunctionsWithDifferentCallingConventions) { + // These attributes may not be available on certain platforms. + if (llvm::Triple(llvm::sys::getDefaultTargetTriple()).getArch() != + llvm::Triple::x86_64) + return; auto t = makeNamedDecls( "__attribute__((preserve_all)) void foo();", "__attribute__((ms_abi)) void foo();", @@ -390,13 +392,15 @@ TEST_F(StructuralEquivalenceFunctionTest, } TEST_F(StructuralEquivalenceFunctionTest, FunctionsWithDifferentSavedRegsAttr) { + if (llvm::Triple(llvm::sys::getDefaultTargetTriple()).getArch() != + llvm::Triple::x86_64) + return; auto t = makeNamedDecls( "__attribute__((no_caller_saved_registers)) void foo();", " void foo();", Lang_C); EXPECT_FALSE(testStructuralMatch(t)); } -#endif struct StructuralEquivalenceCXXMethodTest : StructuralEquivalenceTest { }; |