Skip to content

Update LLVM - #2976

Merged
Casey Carter (CaseyCarter) merged 81 commits into
microsoft:mainfrom
fsb4000:llvm_casey
Oct 10, 2022
Merged

Update LLVM#2976
Casey Carter (CaseyCarter) merged 81 commits into
microsoft:mainfrom
fsb4000:llvm_casey

Conversation

@fsb4000

@fsb4000 Igor Zhukov (fsb4000) commented Jul 31, 2022

Copy link
Copy Markdown
Contributor

Updates the reference for the STL's llvm-project submodule. Doing so necessitates changes to:

  • basic_string::resize_and_overwrite to enable a libc++ test to pass
  • pointer_traits::pointer_to so "fancy pointers" work with constexpr basic_string (LWG-3454)
  • Additions and removals to the expected_results.txt and skipped_tests.txt files that control the external and internal libc++ test runners
  • Remove the workaround for LLVM-53957 which has been fixed
  • Sync P0088R3_variant, P0220R1_any, and P220R1_optional tests with their upstream libc++ sources

Drive-by:

  • sync tests/std/tests/P0088R3_variant/env.lst with usual_17_matrix.lst

Dual of MSVC-PR-428240.

Casey Carter (CaseyCarter) and others added 10 commits July 31, 2022 14:19
by passing non-`const` lvalues to the user's operation as specified.

Drive-by: avoid sign/conversion warnings in the debug checks, and explicitly convert the op result to `size_type` in the call to `_Eos`.
don't define `_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS` and `_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING`
@CaseyCarter Casey Carter (CaseyCarter) added the test Related to test code label Jul 31, 2022
Comment thread stl/inc/xutility

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've investigated a few count of failed cases.
It seems that some case should have passed according to godbolt. I don't know what's going wrong.

Comment thread tests/libcxx/expected_results.txt Outdated
Comment thread tests/libcxx/expected_results.txt Outdated
Comment thread tests/libcxx/expected_results.txt Outdated
@fsb4000

Copy link
Copy Markdown
Contributor Author

What do we do when libc++ tests fail/pass on ARM but pass/fail on AMD64? Do we mark them SKIPPED?

And yes, I have read P0088R3_variant, P0220R1_any, P0220R1_optional tests and I will update them later.

@StephanTLavavej

Copy link
Copy Markdown
Member

What do we do when libc++ tests fail/pass on ARM but pass/fail on AMD64? Do we mark them SKIPPED?

Yeah - currently we don't have a way to do per-architecture FAILs.

@frederick-vs-ja

Copy link
Copy Markdown
Contributor

This test fails for 32-bit platforms because of truncation from (unsigned) long long to 32-bit size_t. Perhaps we can and should fix the libc++ test by using static_cast.

  • std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval.pass.cpp

This test seemly fails for ARM/ARM64 platforms because MSVC STL considers tinyness_before to be always false even for ARM, but libc++ considers it to be true for floating-point types on ARM. I don't know which is right.

  • std/language.support/support.limits/limits/numeric.limits.members/tinyness_before.pass.cpp

Currently we may have to skip tests with difference results on difference architectures.

@fsb4000

Copy link
Copy Markdown
Contributor Author

I created https://reviews.llvm.org/D130963

@cpplearner S. B. Tam (cpplearner) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a non-exhaustive analysis.

Comment thread tests/libcxx/expected_results.txt Outdated
Comment thread tests/libcxx/expected_results.txt Outdated
Comment thread tests/libcxx/expected_results.txt Outdated
Comment thread tests/libcxx/expected_results.txt Outdated
Comment thread tests/libcxx/expected_results.txt Outdated
Comment thread tests/libcxx/expected_results.txt Outdated
Comment thread tests/libcxx/expected_results.txt
Comment thread tests/libcxx/expected_results.txt Outdated
Comment thread tests/libcxx/expected_results.txt Outdated
@CaseyCarter
Casey Carter (CaseyCarter) marked this pull request as ready for review October 6, 2022 10:56
@CaseyCarter
Casey Carter (CaseyCarter) requested a review from a team as a code owner October 6, 2022 10:56
@CaseyCarter

This comment was marked as resolved.

@azure-pipelines

This comment was marked as resolved.

1 similar comment
@azure-pipelines

This comment was marked as outdated.

memfrob (mem-frob) pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
…amp/rand.dist.samp.discrete/eval.pass.cpp

frederick-vs-ja noticed that microsoft/STL#2976 (comment)
while we are working on updating LLVM submodule for MS STL:

    [...]\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(33): error C2220: the following warning is treated as an error
    [...]\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(287): note: see reference to function template instantiation 'void tests<__int64>(void)' being compiled
    [...]\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(33): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data

Differential Revision: https://reviews.llvm.org/D130963

(cherry picked from commit db0ac307c9df26d26a629552aec0a78f1b492dfd)
memfrob (mem-frob) pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
…mory>` in tests

Found by @cpplearner (microsoft/STL#2976 (comment))

Differential Revision: https://reviews.llvm.org/D130997

(cherry picked from commit 495519e5f8232d144ed26e9c18dbcbac6a5f25eb)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks very reasonable

PM_CL="/BE /c /EHsc /MT /std:c++20 /permissive-"
PM_CL="/BE /c /EHsc /MTd /std:c++latest /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing /EHsc /MD /std:c++20 /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing /EHsc /MD /std:c++latest /permissive-"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does c++latest not imply /permissive- for clang?

@CaseyCarter Casey Carter (CaseyCarter) Oct 8, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK /permissive- is meaningless for clang and cl /BE. I'm only touching this file to sync it back up with usual_17_matrix like the comment says, I don't intend to make any other changes.

That said, we need to make a pass over the env lists one of these days to remove /permissive and /permissive- where they are the defaults and/or meaningless.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang understands /permissive and /permissive- since clang 13: llvm/llvm-project@c70b0e8

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what if anything /Zc:twoPhase- means to clang-cl, since it doesn't accept my test case:

namespace N {
    struct S {};
}

template <class T>
constexpr bool f(T) {
    return true;
}

template <class T>
constexpr bool g(T x) {
    return f(x);
}

constexpr bool f(N::S) {
    return false;
}

static_assert(!g(N::S{}), "");

I'm unable to determine if /std:c++20 and /std:c++latest imply /permissive-.

@strega-nil-ms

Copy link
Copy Markdown
Contributor

Casey Carter (@CaseyCarter) should this now be ready to merge, given that tests pass?

@CaseyCarter

Casey Carter (CaseyCarter) commented Oct 8, 2022

Copy link
Copy Markdown
Contributor

Casey Carter (@CaseyCarter) should this now be ready to merge, given that tests pass?

No, I'm still doing internal testing. (There are a couple classes of test cases that the GitHub test runner knows how to handle which the internal libcxx test runner does not. They need to be SKIPPED manually and aren't always easily detectible.) I'll move this to Final Review when it's green internally and externally.

* `.compile.pass.cpp` tests with no `main`
* `.sh.cpp` tests
* `.verify.cpp` tests
all of which break only in the internal test runner.
Comment thread tests/libcxx/magic_comments.txt
@CaseyCarter
Casey Carter (CaseyCarter) merged commit 1fe4d43 into microsoft:main Oct 10, 2022
@CaseyCarter Casey Carter (CaseyCarter) removed their assignment Oct 10, 2022
@CaseyCarter

Copy link
Copy Markdown
Contributor

Thanks so much for picking this up and finishing it off after I got busy, Igor Zhukov (@fsb4000)! Also thanks to everyone who helped analyze failures and classify issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Related to test code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants