diff --git a/language/tools/move-mv-llvm-compiler/src/main.rs b/language/tools/move-mv-llvm-compiler/src/main.rs index eb55dbea8f..61692fdcb3 100644 --- a/language/tools/move-mv-llvm-compiler/src/main.rs +++ b/language/tools/move-mv-llvm-compiler/src/main.rs @@ -235,6 +235,9 @@ fn main() -> anyhow::Result<()> { // If '-c' option is set, then -o is the directory to output the compiled modules, // each module 'mod' will get file name 'mod.ll' if compilation { + if output_file_path.ends_with('/') { + output_file_path.pop(); + } let mut out_path = Path::new(&output_file_path).to_path_buf().join(modname); out_path.set_extension(&args.output_file_extension); output_file = out_path.to_str().unwrap().to_string(); diff --git a/language/tools/move-mv-llvm-compiler/tests/cli-tests.rs b/language/tools/move-mv-llvm-compiler/tests/cli-tests.rs index 6121179c71..0f862ae33c 100644 --- a/language/tools/move-mv-llvm-compiler/tests/cli-tests.rs +++ b/language/tools/move-mv-llvm-compiler/tests/cli-tests.rs @@ -99,6 +99,8 @@ fn run_test_inner(test_path: &Path) -> anyhow::Result<()> { let dst = &src.join("relative_path_results"); tc::store_results(src, dst)?; + tc::clean_results(src)?; + ///////////////////// // test absolute path tc::run_move_to_llvm_build(