Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
2
2024ustc-jianmu-compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
compiler_staff
2024ustc-jianmu-compiler
Commits
ef67f2f2
Commit
ef67f2f2
authored
Dec 02, 2024
by
刘睿博
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix eval_lab4
parent
5c416b5a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
tests/4-opt/eval_lab4.sh
tests/4-opt/eval_lab4.sh
+18
-7
tests/4-opt/test_perf.sh
tests/4-opt/test_perf.sh
+3
-2
No files found.
tests/4-opt/eval_lab4.sh
View file @
ef67f2f2
...
...
@@ -9,7 +9,8 @@ LOG=log.txt
usage
()
{
cat
<<
JIANMU
Usage:
$0
[path-to-testcases] [type]
Usage:
$0
[test-stage] [path-to-testcases] [type]
test-stage: 'licm' or 'mem2reg'
path-to-testcases: './testcases/functional-cases' or '../testcases_general' or 'self made cases'
type: 'debug' or 'test', debug will output .ll file
JIANMU
...
...
@@ -30,16 +31,26 @@ check_return_value() {
}
# check arguments
[
$#
-lt
2
]
&&
usage
if
[
"
$
2
"
==
"debug"
]
;
then
[
$#
-lt
3
]
&&
usage
if
[
"
$
3
"
==
"debug"
]
;
then
debug_mode
=
true
elif
[
"
$
2
"
==
"test"
]
;
then
elif
[
"
$
3
"
==
"test"
]
;
then
debug_mode
=
false
else
usage
fi
test_dir
=
$1
if
[
"
$1
"
==
"licm"
]
;
then
licm
=
true
flag
=
"-mem2reg -licm"
elif
[
"
$1
"
==
"mem2reg"
]
;
then
licm
=
false
flag
=
"-mem2reg"
else
usage
fi
test_dir
=
$2
testcases
=
$(
ls
"
$test_dir
"
/
*
.
"
$suffix
"
|
sort
-V
)
check_return_value
$?
0
"PATH"
"unable to access to '
$test_dir
'"
||
exit
1
...
...
@@ -75,10 +86,10 @@ for case in $testcases; do
echo
-n
"
$case_base_name
..."
# if debug mode on, generate .ll also
if
[
$debug_mode
=
true
]
;
then
bash
-c
"cminusfc
-mem2re
g -emit-llvm
$case
-o
$ll_file
"
>>
$LOG
2>&1
bash
-c
"cminusfc
$fla
g
-emit-llvm
$case
-o
$ll_file
"
>>
$LOG
2>&1
fi
# cminusfc compile to .s
bash
-c
"cminusfc -S
-mem2re
g
$case
-o
$asm_file
"
>>
$LOG
2>&1
bash
-c
"cminusfc -S
$fla
g
$case
-o
$asm_file
"
>>
$LOG
2>&1
check_return_value
$?
0
"CE"
"cminusfc compiler error"
||
continue
# gcc compile asm to executable
...
...
tests/4-opt/test_perf.sh
View file @
ef67f2f2
...
...
@@ -22,7 +22,8 @@ check_return_value() {
usage
()
{
cat
<<
JIANMU
Usage:
$0
[licm | mem2reg]
Usage:
$0
test-type
test-type: 'licm' or 'mem2reg'
JIANMU
exit
0
}
...
...
@@ -30,7 +31,7 @@ JIANMU
[
$#
-lt
1
]
&&
usage
if
[
"
$1
"
==
"licm"
]
;
then
licm
=
true
nf
al
g
=
"-mem2reg"
nf
la
g
=
"-mem2reg"
flag
=
"-mem2reg -licm"
elif
[
"
$1
"
==
"mem2reg"
]
;
then
licm
=
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment