Skip to content

Commit

Permalink
Added CMakeLists changes, moved config and made test scripts compatible.
Browse files Browse the repository at this point in the history
All Fortran tests are now run in lit, except Preprocessing tests flang-compiler#1052
Preprocessing tests are a separate kind of test, so will be sorted out
later.
  • Loading branch information
LukeIreland1 committed Mar 11, 2020
1 parent 8c09942 commit c4165a0
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 388 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ add_subdirectory(lib)
add_subdirectory(runtime)
add_subdirectory(unittests)
add_subdirectory(tools)
add_subdirectory(test-lit)
add_subdirectory(test)

configure_file(
${FLANG_SOURCE_DIR}/include/flang/Config/config.h.cmake
Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions test/Evaluate/lit.local.cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- Python -*-

import os
import platform
import sys

import lit.formats
from lit.llvm import llvm_config
from distutils.util import strtobool

# lit --param=LIBPGMATH="True" <build>/test/Evaluate
result = lit_config.params.get("LIBPGMATH")
if result:
result = strtobool(result)
if result:
config.environment["LIBPGMATH"] = "True"

19 changes: 7 additions & 12 deletions test/Evaluate/test_folding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,21 @@
# - 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

# Check if tests should assume folding is using libpgmath
if [[ $# > 1 && "$2" = "-pgmath=true" ]]; then
if [[ $LIBPGMATH == "True" ]]; then
CMD="$CMD -DTEST_LIBPGMATH"
echo "Assuming libpgmath support"
fi
Expand Down
7 changes: 7 additions & 0 deletions test/Preprocessing/lit.local.cfg.py
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 = []
Loading

0 comments on commit c4165a0

Please sign in to comment.