Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
XChy committed Aug 5, 2023
1 parent 70a7ec2 commit a9d8068
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Input the command below in to build XSharp Compiler in your computer(**Only supp

```bash
# Install LLVM dependencies for XSharp
sudo apt install llvm-dev
sudo apt install llvm-15

# Install toolchain for compiling XSharp
sudo apt install build-essential
Expand All @@ -47,7 +47,7 @@ bin/xsharp xxx.xe # execute the bytecode
- ##### **LLVM** (**optional**)

XSharp can compile XSharp code into LLVM IR, which
XSharp apply **LLVM14(or above)** to compile and optimize to generate binary.
XSharp apply **LLVM15(or above)** to compile and optimize to generate binary.

- ##### **FMT**

Expand Down
16 changes: 9 additions & 7 deletions test/xsharp-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
with open(source_path, mode="r") as source:
os.makedirs(os.path.join(llvm_test_path, "temp"), exist_ok=True)
temp_path = os.path.join(llvm_test_path, "temp", file + ".ll")
code = os.system(xsharpc_path + " --emit-llvm-ir " + file_path + " -o " + temp_path)
code = os.system(
xsharpc_path + " --emit-llvm-ir " + file_path + " -o " + temp_path
)

with open(temp_path, mode="r") as temp:
temp_lines = temp.readlines()
Expand All @@ -53,12 +55,12 @@

if ir_lines != temp_lines:
failure_test += 1
print("[{}] [LLVM] Test failed at {}:".format(total_test,source_path))
print("[{}] [LLVM] Test failed at {}:".format(total_test, source_path))

if args.verbose:
print(''.join(list(difflib.ndiff(ir_lines, temp_lines))))
print("".join(list(difflib.ndiff(ir_lines, temp_lines))))
else:
print("[{}] [LLVM] Test passed {}:".format(total_test,source_path))
print("[{}] [LLVM] Test passed {}:".format(total_test, source_path))

# Test Parser
parser_test_path = os.path.join(project_path, "XSharp/test/Parser")
Expand All @@ -85,12 +87,12 @@

if ir_lines != temp_lines:
failure_test += 1
print("[{}] [Parser] Test failed at {}:".format(total_test,source_path))
print("[{}] [Parser] Test failed at {}:".format(total_test, source_path))

if args.verbose:
print(''.join(list(difflib.ndiff(ir_lines, temp_lines))))
print("".join(list(difflib.ndiff(ir_lines, temp_lines))))
else:
print("[{}] [Parser] Test passed {}:".format(total_test,source_path))
print("[{}] [Parser] Test passed {}:".format(total_test, source_path))


print("===================Test Completed=======================")
Expand Down

0 comments on commit a9d8068

Please sign in to comment.