[clang][test] Use sizeof(wchar_t) instead of __WCHAR_WIDTH__ - #218707
Merged
Conversation
|
@llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes
Full diff: https://github.com/llvm/llvm-project/pull/218707.diff 1 Files Affected:
diff --git a/clang/unittests/AST/ByteCode/Pointer.cpp b/clang/unittests/AST/ByteCode/Pointer.cpp
index a42388d434c0c..bc45da69a0410 100644
--- a/clang/unittests/AST/ByteCode/Pointer.cpp
+++ b/clang/unittests/AST/ByteCode/Pointer.cpp
@@ -315,7 +315,7 @@ TEST(Pointer, Strings) {
Pointee = GlobalPtr.load<Pointer>();
ASSERT_TRUE(Pointee.isStringPointer());
ASSERT_EQ(Pointee.getNumElems(), 7u);
- ASSERT_EQ(Pointee.elemSize(), __WCHAR_WIDTH__ / 8u);
+ ASSERT_EQ(Pointee.elemSize(), sizeof(wchar_t));
D = match(varDecl(hasGlobalStorage(), hasName("c")).bind("c"), ASTCtx)[0]
.getNodeAs<VarDecl>("c");
@@ -327,12 +327,12 @@ TEST(Pointer, Strings) {
Pointee = GlobalPtr.load<Pointer>();
ASSERT_TRUE(Pointee.isStringPointer());
ASSERT_EQ(Pointee.getNumElems(), 7u);
- ASSERT_EQ(Pointee.elemSize(), __WCHAR_WIDTH__ / 8u);
+ ASSERT_EQ(Pointee.elemSize(), sizeof(wchar_t));
ASSERT_EQ(Pointee.getIndex(), 5u);
APValue APV = Pointee.toAPValue(ASTCtx);
ASSERT_TRUE(APV.isLValue());
ASSERT_FALSE(APV.isLValueOnePastTheEnd());
- ASSERT_EQ(APV.getLValueOffset().getQuantity(), 5u * (__WCHAR_WIDTH__ / 8u));
+ ASSERT_EQ(APV.getLValueOffset().getQuantity(), 5u * sizeof(wchar_t));
ASSERT_TRUE(APV.hasLValuePath());
const auto &Path = APV.getLValuePath();
ASSERT_EQ(Path.size(), 1u);
|
Contributor
|
looks like these changes cause the same for https://lab.llvm.org/buildbot/#/builders/193/builds/18296 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
__WCHAR_WIDTH__does not exist everywhere and this broke a builder: https://lab.llvm.org/buildbot/#/builders/2/builds/60118