Attempt to fix code completion test to handle LLP64 platforms

llvm-svn: 349086
This commit is contained in:
Reid Kleckner 2018-12-13 21:41:07 +00:00
parent 7ac3f47f64
commit 82b6f98f9a
1 changed files with 3 additions and 1 deletions

View File

@ -213,7 +213,9 @@ TEST(PreferredTypeTest, BinaryExpr) {
ptr += ^10;
ptr -= ^10;
})cpp";
EXPECT_THAT(collectPreferredTypes(Code), Each("long")); // long is normalized 'ptrdiff_t'.
// Expect the normalized ptrdiff_t type, which is typically long or long long.
const char *PtrDiff = sizeof(void *) == sizeof(long) ? "long" : "long long";
EXPECT_THAT(collectPreferredTypes(Code), Each(PtrDiff));
// Comparison operators.
Code = R"cpp(