-
Notifications
You must be signed in to change notification settings - Fork 17
[tests] Re-enable unittesting and partial fix for the existing errors #249
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,7 +128,7 @@ void populateCPURuntimePasses(mlir::OpPassManager &pm) { | |
pm.addPass(createForallToParallelLoopPass()); | ||
pm.addPass(createParallelLoopFusionPass()); | ||
pm.addPass(createLoopInvariantCodeMotionPass()); | ||
pm.addPass(createConvertMemRefToCPURuntime()); | ||
pm.addNestedPass<func::FuncOp>(createConvertMemRefToCPURuntime()); | ||
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. can we merge this now? bench tool has an issue for some mlir, and it needs this change. |
||
pm.addPass(createConvertSCFToOpenMPPass()); | ||
populateCleanUpPasses(pm); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -*- Python -*- | ||
|
||
# Configuration file for the 'lit' test runner. | ||
|
||
import os | ||
import subprocess | ||
|
||
import lit.formats | ||
|
||
# name: The name of this test suite. | ||
config.name = "GC-Unit" | ||
|
||
# suffixes: A list of file extensions to treat as test files. | ||
config.suffixes = [] | ||
|
||
# test_source_root: The root path where tests are located. | ||
# test_exec_root: The root path where tests should be run. | ||
config.test_exec_root = os.path.join(config.gc_obj_root, "test", "mlir", "unittests") | ||
config.test_source_root = config.test_exec_root | ||
|
||
# testFormat: The test format to use to interpret tests. | ||
config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, "Tests") | ||
|
||
# Propagate the temp directory. Windows requires this because it uses \Windows\ | ||
# if none of these are present. | ||
if "TMP" in os.environ: | ||
config.environment["TMP"] = os.environ["TMP"] | ||
if "TEMP" in os.environ: | ||
config.environment["TEMP"] = os.environ["TEMP"] | ||
|
||
# Propagate HOME as it can be used to override incorrect homedir in passwd | ||
# that causes the tests to fail. | ||
if "HOME" in os.environ: | ||
config.environment["HOME"] = os.environ["HOME"] | ||
Comment on lines
+26
to
+34
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. nit: seems we can also put these into var list below? |
||
|
||
# Propagate sanitizer options. | ||
for var in [ | ||
"ASAN_SYMBOLIZER_PATH", | ||
"HWASAN_SYMBOLIZER_PATH", | ||
"MSAN_SYMBOLIZER_PATH", | ||
"TSAN_SYMBOLIZER_PATH", | ||
"UBSAN_SYMBOLIZER_PATH", | ||
"ASAN_OPTIONS", | ||
"HWASAN_OPTIONS", | ||
"MSAN_OPTIONS", | ||
"TSAN_OPTIONS", | ||
"UBSAN_OPTIONS", | ||
]: | ||
if var in os.environ: | ||
config.environment[var] = os.environ[var] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@LIT_SITE_CFG_IN_HEADER@ | ||
|
||
import sys | ||
config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") | ||
config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") | ||
config.mlir_obj_root = "@MLIR_BINARY_DIR@" | ||
config.gc_src_root = "@CMAKE_SOURCE_DIR@" | ||
config.gc_obj_root = "@PROJECT_BINARY_DIR@" | ||
config.gc_lib_dir = os.path.join(config.gc_obj_root, "lib") | ||
|
||
# Let the main config do the real work. | ||
lit_config.load_config(config, "@CMAKE_SOURCE_DIR@/test/mlir/test/gc/Unit/lit.cfg.py") |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ dlti.target_system_spec = #dlti.target_system_spec< | |
>} {} | ||
)mlir"; | ||
|
||
TEST(TargetDescriptionAnalysis, CPUMissingValue) { | ||
TEST(DISABLED_TargetDescriptionAnalysis, CPUMissingValue) { | ||
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. We need to re-enable this UT after it is fixed. 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. Please add a TODO/FIXME for future reminder |
||
MLIRContext ctx{gc::initCompilerAndGetDialects()}; | ||
std::unique_ptr<llvm::MemoryBuffer> ir_buffer = | ||
llvm::MemoryBuffer::getMemBuffer(code2); | ||
|
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.
These lines originally occur after including LLVM cmake, so we don't need to include them by ourselves. A recent refactor swaps the location of these lines with include(LLVM...), so it breaks cmake when g++ < 10.0