fix: modification des scripts pour gérer les versions de clang
This commit is contained in:
23
compile
23
compile
@@ -13,4 +13,25 @@ name="`dirname $1`/`basename $1 .vsl`"
|
||||
# translating from VSL to LLVM IR (.ll)
|
||||
java -jar build/libs/TP2.jar < $name.vsl > $name.ll
|
||||
|
||||
clang $name.ll -o $name
|
||||
# Check clang version
|
||||
if command -v clang-20 2>&1 >/dev/null
|
||||
then
|
||||
cl=clang-20
|
||||
else
|
||||
if command -v clang-19 2>&1 >/dev/null
|
||||
then
|
||||
cl=clang-19
|
||||
else
|
||||
if command -v clang-18 2>&1 >/dev/null
|
||||
then
|
||||
cl=clang-18
|
||||
else
|
||||
if command -v clang-17 2>&1 >/dev/null
|
||||
then
|
||||
cl=clang-17
|
||||
else
|
||||
cl=clang
|
||||
fi fi fi fi
|
||||
|
||||
# Compile using clang
|
||||
$cl $name.ll -o $name
|
||||
@@ -9,6 +9,17 @@ from colorama import Style
|
||||
|
||||
stats = {}
|
||||
|
||||
# Détermine quel est l'exécutable clang utilisable.
|
||||
# Note : à l'istic c'est clang-19
|
||||
def clangName():
|
||||
for name in ["clang-" + str(v) for v in range(20,16,-1)]:
|
||||
p = subprocess.run(f"command -v {name} 2>&1 >/dev/null", shell=True)
|
||||
if p.returncode == 0 :
|
||||
return name
|
||||
return "clang"
|
||||
|
||||
clang = clangName()
|
||||
|
||||
def runTestNormalLevel(level):
|
||||
print(f"Running test of level {level}")
|
||||
stats[level] = (0,0,0,0)
|
||||
@@ -37,7 +48,7 @@ def runNormalTest(i, dirname,filename):
|
||||
|
||||
# LLVM -> Bin
|
||||
if vslToLLVM :
|
||||
p = subprocess.run(f"clang {basename}.ll -o {basename} 2>/dev/null", shell=True)
|
||||
p = subprocess.run(f"{clang} {basename}.ll -o {basename} 2>/dev/null", shell=True)
|
||||
if p.returncode == 0:
|
||||
llvmToBin = True
|
||||
executionCorrect = True
|
||||
|
||||
Reference in New Issue
Block a user