-
Notifications
You must be signed in to change notification settings - Fork 49
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
Porting F18 tests to use LLVM lit without FileCheck #1027
Changes from all commits
4de19d7
2bfddbe
63ec0af
3f99d35
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,30 @@ | ||
#===-- test/CMakeLists.txt -------------------------------------------------===# | ||
# | ||
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# | ||
#===------------------------------------------------------------------------===# | ||
|
||
add_subdirectory(Decimal) | ||
add_subdirectory(Evaluate) | ||
add_subdirectory(Runtime) | ||
add_subdirectory(Semantics) | ||
# Test runner infrastructure for Flang. This configures the Flang test trees | ||
# for use by Lit, and delegates to LLVM's lit test handlers. | ||
|
||
set(FLANG_INTRINSIC_MODULES_DIR ${FLANG_BINARY_DIR}/tools/f18/include) | ||
|
||
configure_lit_site_cfg( | ||
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in | ||
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py | ||
MAIN_CONFIG | ||
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py | ||
) | ||
|
||
set(FLANG_TEST_PARAMS | ||
flang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py) | ||
|
||
set(FLANG_TEST_DEPENDS | ||
f18 | ||
) | ||
|
||
if (LINK_WITH_FIR) | ||
list(APPEND FLANG_TEST_DEPENDS tco) | ||
endif() | ||
|
||
add_lit_testsuite(check-all "Running the Flang regression tests" | ||
${CMAKE_CURRENT_BINARY_DIR} | ||
PARAMS ${FLANG_TEST_PARAMS} | ||
DEPENDS ${FLANG_TEST_DEPENDS} | ||
) | ||
set_target_properties(check-all PROPERTIES FOLDER "Tests") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
! RUN: %S/test_folding.sh %s %flang %t | ||
|
||
! Test intrinsic operation folding | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
! RUN: %S/test_folding.sh %s %flang %t | ||
! Check intrinsic function folding with host runtime library | ||
|
||
module m | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
! RUN: %S/test_folding.sh %s %flang %t | ||
! Test transformational intrinsic function folding | ||
|
||
module m | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
! RUN: %S/test_folding.sh %s %flang %t | ||
! Test numeric model inquiry intrinsics | ||
|
||
module m | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
! RUN: %S/test_folding.sh %s %flang %t | ||
! Test folding of LBOUND and UBOUND | ||
|
||
module m | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,28 +19,25 @@ | |
# - test_x is not folded (it is neither .true. nor .false.). This means the | ||
# compiler could not fold the expression. | ||
|
||
PATH=/usr/bin:/bin | ||
srcdir=$(dirname $0) | ||
F18CC=${F18:-../../../tools/f18/bin/f18} | ||
CMD="$F18CC -fdebug-dump-symbols -fparse-only" | ||
CMD="$2 -fdebug-dump-symbols -fparse-only" | ||
|
||
if [[ $# < 1 ]]; then | ||
echo "Usage: $0 <fortran-source> [-pgmath=<true/false>]" | ||
if [[ $# < 3 ]]; then | ||
echo "Usage: $0 <fortran-source> <f18-executable> <temp test dir>" | ||
exit 1 | ||
fi | ||
|
||
src=$srcdir/$1 | ||
src=$1 | ||
[[ ! -f $src ]] && echo "File not found: $src" && exit 1 | ||
|
||
temp=temp-$1 | ||
rm -rf $temp | ||
mkdir $temp | ||
[[ $KEEP ]] || trap "rm -rf $temp" EXIT | ||
temp=$3 | ||
mkdir -p $temp | ||
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. Shouldn't this be |
||
|
||
# Check if tests should assume folding is using libpgmath | ||
if [[ $# > 1 && "$2" = "-pgmath=true" ]]; then | ||
if [[ $LIBPGMATH ]]; then | ||
CMD="$CMD -DTEST_LIBPGMATH" | ||
echo "Assuming libpgmath support" | ||
else | ||
echo "Not assuming libpgmath support" | ||
fi | ||
|
||
src1=$temp/symbols.log | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- Python -*- | ||
|
||
from lit.llvm import llvm_config | ||
|
||
# Added this line file to prevent lit from discovering these tests | ||
# See Issue #1052 | ||
config.suffixes = [] |
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.
This is a bug and only works when compiling f18 standalone. LLVM already has a cmake target of "check-all" and this will conflict with it.
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've fixed this already in the cmake rework PR. Check-all will still exist as a if flang is built out of tree running only flang tests, and the check-flang target will always exist and always only run flang tests.