-
Notifications
You must be signed in to change notification settings - Fork 15k
[Flang-RT][libc] LLVM-independent unittests #164794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Meinersbur
wants to merge
5
commits into
llvm:main
Choose a base branch
from
Meinersbur:flangrt_gtest-independence
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
|
|
||
| function (build_gtest gtest_name) | ||
| cmake_parse_arguments(ARG "LLVM_SUPPORT" "" "" ${ARGN}) | ||
|
|
||
| if (ARG_LLVM_SUPPORT) | ||
| set(GTEST_USE_LLVM 1) | ||
| else () | ||
| set(GTEST_USE_LLVM 0) | ||
| endif () | ||
| add_subdirectory("${LLVM_THIRD_PARTY_DIR}/unittest" "${CMAKE_BINARY_DIR}/third-party/${gtest_name}_gtest") | ||
| endfunction () | ||
|
|
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,6 @@ | |
| #include "flang-rt/runtime/descriptor.h" | ||
| #include "flang/Common/ISO_Fortran_binding_wrapper.h" | ||
| #include "flang/Testing/testing.h" | ||
| #include "llvm/Support/raw_ostream.h" | ||
| #include <type_traits> | ||
|
|
||
| using namespace Fortran::runtime; | ||
|
|
@@ -73,26 +72,9 @@ static void AddNoiseToCdesc(CFI_cdesc_t *dv, CFI_rank_t rank) { | |
| } | ||
| } | ||
|
|
||
| #ifdef VERBOSE | ||
| static void DumpTestWorld(const void *bAddr, CFI_attribute_t attr, | ||
| CFI_type_t ty, std::size_t eLen, CFI_rank_t rank, | ||
| const CFI_index_t *eAddr) { | ||
| llvm::outs() << " base_addr: "; | ||
| llvm::outs().write_hex(reinterpret_cast<std::intptr_t>(bAddr)) | ||
| << " attribute: " << static_cast<int>(attr) | ||
| << " type: " << static_cast<int>(ty) << " elem_len: " << eLen | ||
| << " rank: " << static_cast<int>(rank) << " extent: "; | ||
| llvm::outs().write_hex(reinterpret_cast<std::intptr_t>(eAddr)) << '\n'; | ||
| llvm::outs().flush(); | ||
| } | ||
| #endif | ||
|
|
||
| static void check_CFI_establish(CFI_cdesc_t *dv, void *base_addr, | ||
| CFI_attribute_t attribute, CFI_type_t type, std::size_t elem_len, | ||
| CFI_rank_t rank, const CFI_index_t extents[]) { | ||
| #ifdef VERBOSE | ||
| DumpTestWorld(base_addr, attribute, type, elem_len, rank, extent); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does not even compile (extents) |
||
| #endif | ||
| // CFI_establish reqs from F2018 section 18.5.5 | ||
| int retCode{ | ||
| CFI_establish(dv, base_addr, attribute, type, elem_len, rank, extents)}; | ||
|
|
@@ -305,9 +287,6 @@ static void check_CFI_allocate(CFI_cdesc_t *dv, | |
| const CFI_type_t type{dv->type}; | ||
| const void *base_addr{dv->base_addr}; | ||
| const int version{dv->version}; | ||
| #ifdef VERBOSE | ||
| DumpTestWorld(base_addr, attribute, type, elem_len, rank, nullptr); | ||
| #endif | ||
| int retCode{CFI_allocate(dv, lower_bounds, upper_bounds, elem_len)}; | ||
| Descriptor *desc = reinterpret_cast<Descriptor *>(dv); | ||
| if (retCode == CFI_SUCCESS) { | ||
|
|
||
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose that this warning will change or become unreachable.