Commit d407e23f authored by Cyril SIX's avatar Cyril SIX
Browse files

MPPA - Automatic generation of expected value for tests

parent 1ecd47e8
......@@ -23,10 +23,13 @@ $(DIR)/$(ASMDIR)/%.s: $(DIR)/%.c $(CCOMP)
@mkdir -p $(@D)
ccomp $(DEBUG) -O0 -v -S $< -o $@
$(DIR)/$(BINDIR)/%.tok: $(DIR)/$(BINDIR)/%.bin
$(DIR)/$(BINDIR)/%.tok: $(DIR)/$(BINDIR)/%.bin $(DIR)/output/%.bin.exp
@mkdir -p $(@D)
@bash check.sh $< $@
$(DIR)/output/%.bin.exp: $(DIR)/%.c
@bash generate.sh $< $@
.PHONY: FORCE
FORCE:
......@@ -45,7 +48,9 @@ clean:
rm -f $(DIR)/*.parsed.c
rm -f $(DIR)/*.rtl.?
rm -f $(DIR)/$(ASMDIR)/*.s
rm -f $(DIR)/$(BINDIR)/*.[bin,tok]
rm -f $(DIR)/$(BINDIR)/*.bin
rm -f $(DIR)/$(BINDIR)/*.tok
rm -f $(DIR)/output/*.out
rm -f $(DIR)/output/*.exp
rm -rf $(DIR)/profile/
rm -f $(ELF)
......@@ -10,3 +10,4 @@ int main(void){
return b;
}
/* RETURN VALUE: 5 */
......@@ -10,3 +10,4 @@ int main(void){
return b;
}
/* RETURN VALUE: 3 */
......@@ -10,3 +10,4 @@ int main(void){
return b;
}
/* RETURN VALUE: 3 */
......@@ -14,3 +14,5 @@ int main(void){
return sum(make_42(), make_18());
//return make_42() + make_18();
}
/* RETURN VALUE: 60 */
......@@ -7,3 +7,5 @@ int main(void){
return a;
}
/* RETURN VALUE: 16 */
......@@ -8,3 +8,5 @@ int main(void){
return a;
}
/* RETURN VALUE: 16 */
......@@ -9,3 +9,5 @@ int main(void)
return 0;
}
/* RETURN VALUE: 0 */
......@@ -4,3 +4,5 @@ int main(void){
return (a+b);
}
/* RETURN VALUE: 7 */
# $1: c file to examine
# $2: write file
cfile="$1"
writefile="$2"
if [ ! -f $cfile ]; then
>&2 echo "ERROR: $cfile not found"
shift; continue
fi
sed -n "s/^.*\/\*\s*RETURN VALUE:\s*\([0-9]*\)\s*\*\//\1/p" $1 > $2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment