Last active
October 20, 2020 04:03
-
-
Save systemhalted/9df4624962d963c4eb52fe17830c3c99 to your computer and use it in GitHub Desktop.
CS6340 Lab 3 Test script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int argc, char **argv) { | |
double x = 4.2; | |
int y = (int)x; | |
int z = 8; | |
z = 4 / y; | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== Reaching Definition (Out) === | |
Out("store i32 0, i32* %retval, align 4", "store i32 0, i32* %retval, align 4") | |
Out("store i32 %argc, i32* %argc.addr, align 4", "store i32 0, i32* %retval, align 4") | |
Out("store i32 %argc, i32* %argc.addr, align 4", "store i32 %argc, i32* %argc.addr, align 4") | |
Out("store i8** %argv, i8*** %argv.addr, align 8", "store i32 0, i32* %retval, align 4") | |
Out("store i8** %argv, i8*** %argv.addr, align 8", "store i32 %argc, i32* %argc.addr, align 4") | |
Out("store i8** %argv, i8*** %argv.addr, align 8", "store i8** %argv, i8*** %argv.addr, align 8") | |
Out("store double 4.200000e+00, double* %x, align 8", "store i32 0, i32* %retval, align 4") | |
Out("store double 4.200000e+00, double* %x, align 8", "store i32 %argc, i32* %argc.addr, align 4") | |
Out("store double 4.200000e+00, double* %x, align 8", "store i8** %argv, i8*** %argv.addr, align 8") | |
Out("store double 4.200000e+00, double* %x, align 8", "store double 4.200000e+00, double* %x, align 8") | |
Out("%0 = load double, double* %x, align 8", "store i32 0, i32* %retval, align 4") | |
Out("%0 = load double, double* %x, align 8", "store i32 %argc, i32* %argc.addr, align 4") | |
Out("%0 = load double, double* %x, align 8", "store i8** %argv, i8*** %argv.addr, align 8") | |
Out("%0 = load double, double* %x, align 8", "store double 4.200000e+00, double* %x, align 8") | |
Out("%0 = load double, double* %x, align 8", "%0 = load double, double* %x, align 8") | |
Out("%conv = fptosi double %0 to i32", "store i32 0, i32* %retval, align 4") | |
Out("%conv = fptosi double %0 to i32", "store i32 %argc, i32* %argc.addr, align 4") | |
Out("%conv = fptosi double %0 to i32", "store i8** %argv, i8*** %argv.addr, align 8") | |
Out("%conv = fptosi double %0 to i32", "store double 4.200000e+00, double* %x, align 8") | |
Out("%conv = fptosi double %0 to i32", "%0 = load double, double* %x, align 8") | |
Out("%conv = fptosi double %0 to i32", "%conv = fptosi double %0 to i32") | |
Out("store i32 %conv, i32* %y, align 4", "store i32 0, i32* %retval, align 4") | |
Out("store i32 %conv, i32* %y, align 4", "store i32 %argc, i32* %argc.addr, align 4") | |
Out("store i32 %conv, i32* %y, align 4", "store i8** %argv, i8*** %argv.addr, align 8") | |
Out("store i32 %conv, i32* %y, align 4", "store double 4.200000e+00, double* %x, align 8") | |
Out("store i32 %conv, i32* %y, align 4", "%0 = load double, double* %x, align 8") | |
Out("store i32 %conv, i32* %y, align 4", "%conv = fptosi double %0 to i32") | |
Out("store i32 %conv, i32* %y, align 4", "store i32 %conv, i32* %y, align 4") | |
Out("store i32 8, i32* %z, align 4", "store i32 0, i32* %retval, align 4") | |
Out("store i32 8, i32* %z, align 4", "store i32 %argc, i32* %argc.addr, align 4") | |
Out("store i32 8, i32* %z, align 4", "store i8** %argv, i8*** %argv.addr, align 8") | |
Out("store i32 8, i32* %z, align 4", "store double 4.200000e+00, double* %x, align 8") | |
Out("store i32 8, i32* %z, align 4", "%0 = load double, double* %x, align 8") | |
Out("store i32 8, i32* %z, align 4", "%conv = fptosi double %0 to i32") | |
Out("store i32 8, i32* %z, align 4", "store i32 %conv, i32* %y, align 4") | |
Out("store i32 8, i32* %z, align 4", "store i32 8, i32* %z, align 4") | |
Out("%1 = load i32, i32* %y, align 4", "store i32 0, i32* %retval, align 4") | |
Out("%1 = load i32, i32* %y, align 4", "store i32 %argc, i32* %argc.addr, align 4") | |
Out("%1 = load i32, i32* %y, align 4", "store i8** %argv, i8*** %argv.addr, align 8") | |
Out("%1 = load i32, i32* %y, align 4", "store double 4.200000e+00, double* %x, align 8") | |
Out("%1 = load i32, i32* %y, align 4", "%0 = load double, double* %x, align 8") | |
Out("%1 = load i32, i32* %y, align 4", "%conv = fptosi double %0 to i32") | |
Out("%1 = load i32, i32* %y, align 4", "store i32 %conv, i32* %y, align 4") | |
Out("%1 = load i32, i32* %y, align 4", "store i32 8, i32* %z, align 4") | |
Out("%1 = load i32, i32* %y, align 4", "%1 = load i32, i32* %y, align 4") | |
Out("%div = sdiv i32 4, %1", "store i32 0, i32* %retval, align 4") | |
Out("%div = sdiv i32 4, %1", "store i32 %argc, i32* %argc.addr, align 4") | |
Out("%div = sdiv i32 4, %1", "store i8** %argv, i8*** %argv.addr, align 8") | |
Out("%div = sdiv i32 4, %1", "store double 4.200000e+00, double* %x, align 8") | |
Out("%div = sdiv i32 4, %1", "%0 = load double, double* %x, align 8") | |
Out("%div = sdiv i32 4, %1", "%conv = fptosi double %0 to i32") | |
Out("%div = sdiv i32 4, %1", "store i32 %conv, i32* %y, align 4") | |
Out("%div = sdiv i32 4, %1", "store i32 8, i32* %z, align 4") | |
Out("%div = sdiv i32 4, %1", "%1 = load i32, i32* %y, align 4") | |
Out("%div = sdiv i32 4, %1", "%div = sdiv i32 4, %1") | |
Out("store i32 %div, i32* %z, align 4", "store i32 0, i32* %retval, align 4") | |
Out("store i32 %div, i32* %z, align 4", "store i32 %argc, i32* %argc.addr, align 4") | |
Out("store i32 %div, i32* %z, align 4", "store i8** %argv, i8*** %argv.addr, align 8") | |
Out("store i32 %div, i32* %z, align 4", "store double 4.200000e+00, double* %x, align 8") | |
Out("store i32 %div, i32* %z, align 4", "%0 = load double, double* %x, align 8") | |
Out("store i32 %div, i32* %z, align 4", "%conv = fptosi double %0 to i32") | |
Out("store i32 %div, i32* %z, align 4", "store i32 %conv, i32* %y, align 4") | |
Out("store i32 %div, i32* %z, align 4", "%1 = load i32, i32* %y, align 4") | |
Out("store i32 %div, i32* %z, align 4", "%div = sdiv i32 4, %1") | |
Out("store i32 %div, i32* %z, align 4", "store i32 %div, i32* %z, align 4") | |
Out("ret i32 0", "store i32 0, i32* %retval, align 4") | |
Out("ret i32 0", "store i32 %argc, i32* %argc.addr, align 4") | |
Out("ret i32 0", "store i8** %argv, i8*** %argv.addr, align 8") | |
Out("ret i32 0", "store double 4.200000e+00, double* %x, align 8") | |
Out("ret i32 0", "%0 = load double, double* %x, align 8") | |
Out("ret i32 0", "%conv = fptosi double %0 to i32") | |
Out("ret i32 0", "store i32 %conv, i32* %y, align 4") | |
Out("ret i32 0", "%1 = load i32, i32* %y, align 4") | |
Out("ret i32 0", "%div = sdiv i32 4, %1") | |
Out("ret i32 0", "store i32 %div, i32* %z, align 4") | |
=== Reaching Defintion (In) === | |
In("store i32 %argc, i32* %argc.addr, align 4", "store i32 0, i32* %retval, align 4") | |
In("store i8** %argv, i8*** %argv.addr, align 8", "store i32 0, i32* %retval, align 4") | |
In("store i8** %argv, i8*** %argv.addr, align 8", "store i32 %argc, i32* %argc.addr, align 4") | |
In("store double 4.200000e+00, double* %x, align 8", "store i32 0, i32* %retval, align 4") | |
In("store double 4.200000e+00, double* %x, align 8", "store i32 %argc, i32* %argc.addr, align 4") | |
In("store double 4.200000e+00, double* %x, align 8", "store i8** %argv, i8*** %argv.addr, align 8") | |
In("%0 = load double, double* %x, align 8", "store i32 0, i32* %retval, align 4") | |
In("%0 = load double, double* %x, align 8", "store i32 %argc, i32* %argc.addr, align 4") | |
In("%0 = load double, double* %x, align 8", "store i8** %argv, i8*** %argv.addr, align 8") | |
In("%0 = load double, double* %x, align 8", "store double 4.200000e+00, double* %x, align 8") | |
In("%conv = fptosi double %0 to i32", "store i32 0, i32* %retval, align 4") | |
In("%conv = fptosi double %0 to i32", "store i32 %argc, i32* %argc.addr, align 4") | |
In("%conv = fptosi double %0 to i32", "store i8** %argv, i8*** %argv.addr, align 8") | |
In("%conv = fptosi double %0 to i32", "store double 4.200000e+00, double* %x, align 8") | |
In("%conv = fptosi double %0 to i32", "%0 = load double, double* %x, align 8") | |
In("store i32 %conv, i32* %y, align 4", "store i32 0, i32* %retval, align 4") | |
In("store i32 %conv, i32* %y, align 4", "store i32 %argc, i32* %argc.addr, align 4") | |
In("store i32 %conv, i32* %y, align 4", "store i8** %argv, i8*** %argv.addr, align 8") | |
In("store i32 %conv, i32* %y, align 4", "store double 4.200000e+00, double* %x, align 8") | |
In("store i32 %conv, i32* %y, align 4", "%0 = load double, double* %x, align 8") | |
In("store i32 %conv, i32* %y, align 4", "%conv = fptosi double %0 to i32") | |
In("store i32 8, i32* %z, align 4", "store i32 0, i32* %retval, align 4") | |
In("store i32 8, i32* %z, align 4", "store i32 %argc, i32* %argc.addr, align 4") | |
In("store i32 8, i32* %z, align 4", "store i8** %argv, i8*** %argv.addr, align 8") | |
In("store i32 8, i32* %z, align 4", "store double 4.200000e+00, double* %x, align 8") | |
In("store i32 8, i32* %z, align 4", "%0 = load double, double* %x, align 8") | |
In("store i32 8, i32* %z, align 4", "%conv = fptosi double %0 to i32") | |
In("store i32 8, i32* %z, align 4", "store i32 %conv, i32* %y, align 4") | |
In("%1 = load i32, i32* %y, align 4", "store i32 0, i32* %retval, align 4") | |
In("%1 = load i32, i32* %y, align 4", "store i32 %argc, i32* %argc.addr, align 4") | |
In("%1 = load i32, i32* %y, align 4", "store i8** %argv, i8*** %argv.addr, align 8") | |
In("%1 = load i32, i32* %y, align 4", "store double 4.200000e+00, double* %x, align 8") | |
In("%1 = load i32, i32* %y, align 4", "%0 = load double, double* %x, align 8") | |
In("%1 = load i32, i32* %y, align 4", "%conv = fptosi double %0 to i32") | |
In("%1 = load i32, i32* %y, align 4", "store i32 %conv, i32* %y, align 4") | |
In("%1 = load i32, i32* %y, align 4", "store i32 8, i32* %z, align 4") | |
In("%div = sdiv i32 4, %1", "store i32 0, i32* %retval, align 4") | |
In("%div = sdiv i32 4, %1", "store i32 %argc, i32* %argc.addr, align 4") | |
In("%div = sdiv i32 4, %1", "store i8** %argv, i8*** %argv.addr, align 8") | |
In("%div = sdiv i32 4, %1", "store double 4.200000e+00, double* %x, align 8") | |
In("%div = sdiv i32 4, %1", "%0 = load double, double* %x, align 8") | |
In("%div = sdiv i32 4, %1", "%conv = fptosi double %0 to i32") | |
In("%div = sdiv i32 4, %1", "store i32 %conv, i32* %y, align 4") | |
In("%div = sdiv i32 4, %1", "store i32 8, i32* %z, align 4") | |
In("%div = sdiv i32 4, %1", "%1 = load i32, i32* %y, align 4") | |
In("store i32 %div, i32* %z, align 4", "store i32 0, i32* %retval, align 4") | |
In("store i32 %div, i32* %z, align 4", "store i32 %argc, i32* %argc.addr, align 4") | |
In("store i32 %div, i32* %z, align 4", "store i8** %argv, i8*** %argv.addr, align 8") | |
In("store i32 %div, i32* %z, align 4", "store double 4.200000e+00, double* %x, align 8") | |
In("store i32 %div, i32* %z, align 4", "%0 = load double, double* %x, align 8") | |
In("store i32 %div, i32* %z, align 4", "%conv = fptosi double %0 to i32") | |
In("store i32 %div, i32* %z, align 4", "store i32 %conv, i32* %y, align 4") | |
In("store i32 %div, i32* %z, align 4", "store i32 8, i32* %z, align 4") | |
In("store i32 %div, i32* %z, align 4", "%1 = load i32, i32* %y, align 4") | |
In("store i32 %div, i32* %z, align 4", "%div = sdiv i32 4, %1") | |
In("ret i32 0", "store i32 0, i32* %retval, align 4") | |
In("ret i32 0", "store i32 %argc, i32* %argc.addr, align 4") | |
In("ret i32 0", "store i8** %argv, i8*** %argv.addr, align 8") | |
In("ret i32 0", "store double 4.200000e+00, double* %x, align 8") | |
In("ret i32 0", "%0 = load double, double* %x, align 8") | |
In("ret i32 0", "%conv = fptosi double %0 to i32") | |
In("ret i32 0", "store i32 %conv, i32* %y, align 4") | |
In("ret i32 0", "%1 = load i32, i32* %y, align 4") | |
In("ret i32 0", "%div = sdiv i32 4, %1") | |
In("ret i32 0", "store i32 %div, i32* %z, align 4") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "prelude.h" | |
int main() { | |
char y = 'a'; | |
int x = (int)y; | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== Reaching Definition (Out) === | |
Out("store i32 0, i32* %retval, align 4", "store i32 0, i32* %retval, align 4") | |
Out("store i8 97, i8* %y, align 1", "store i32 0, i32* %retval, align 4") | |
Out("store i8 97, i8* %y, align 1", "store i8 97, i8* %y, align 1") | |
Out("%0 = load i8, i8* %y, align 1", "store i32 0, i32* %retval, align 4") | |
Out("%0 = load i8, i8* %y, align 1", "store i8 97, i8* %y, align 1") | |
Out("%0 = load i8, i8* %y, align 1", "%0 = load i8, i8* %y, align 1") | |
Out("%conv = sext i8 %0 to i32", "store i32 0, i32* %retval, align 4") | |
Out("%conv = sext i8 %0 to i32", "store i8 97, i8* %y, align 1") | |
Out("%conv = sext i8 %0 to i32", "%0 = load i8, i8* %y, align 1") | |
Out("%conv = sext i8 %0 to i32", "%conv = sext i8 %0 to i32") | |
Out("store i32 %conv, i32* %x, align 4", "store i32 0, i32* %retval, align 4") | |
Out("store i32 %conv, i32* %x, align 4", "store i8 97, i8* %y, align 1") | |
Out("store i32 %conv, i32* %x, align 4", "%0 = load i8, i8* %y, align 1") | |
Out("store i32 %conv, i32* %x, align 4", "%conv = sext i8 %0 to i32") | |
Out("store i32 %conv, i32* %x, align 4", "store i32 %conv, i32* %x, align 4") | |
Out("ret i32 0", "store i32 0, i32* %retval, align 4") | |
Out("ret i32 0", "store i8 97, i8* %y, align 1") | |
Out("ret i32 0", "%0 = load i8, i8* %y, align 1") | |
Out("ret i32 0", "%conv = sext i8 %0 to i32") | |
Out("ret i32 0", "store i32 %conv, i32* %x, align 4") | |
=== Reaching Defintion (In) === | |
In("store i8 97, i8* %y, align 1", "store i32 0, i32* %retval, align 4") | |
In("%0 = load i8, i8* %y, align 1", "store i32 0, i32* %retval, align 4") | |
In("%0 = load i8, i8* %y, align 1", "store i8 97, i8* %y, align 1") | |
In("%conv = sext i8 %0 to i32", "store i32 0, i32* %retval, align 4") | |
In("%conv = sext i8 %0 to i32", "store i8 97, i8* %y, align 1") | |
In("%conv = sext i8 %0 to i32", "%0 = load i8, i8* %y, align 1") | |
In("store i32 %conv, i32* %x, align 4", "store i32 0, i32* %retval, align 4") | |
In("store i32 %conv, i32* %x, align 4", "store i8 97, i8* %y, align 1") | |
In("store i32 %conv, i32* %x, align 4", "%0 = load i8, i8* %y, align 1") | |
In("store i32 %conv, i32* %x, align 4", "%conv = sext i8 %0 to i32") | |
In("ret i32 0", "store i32 0, i32* %retval, align 4") | |
In("ret i32 0", "store i8 97, i8* %y, align 1") | |
In("ret i32 0", "%0 = load i8, i8* %y, align 1") | |
In("ret i32 0", "%conv = sext i8 %0 to i32") | |
In("ret i32 0", "store i32 %conv, i32* %x, align 4") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PRECIOUS: %.ll | |
TARGETS=simple0.log simple1.log branch0.log loop0.log branch1.log branch2.log loop1.log cast0.log cast1.log | |
all: ${TARGETS} | |
%.ll: %.c | |
clang -emit-llvm -S -fno-discard-value-names -c -o $@ $< | |
%.log: %.ll | |
../build/constraint $< > $@ 2> $*.err | |
clean: | |
rm -f *.ll *.log *.err ${TARGETS} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ../build | |
make clean | |
make | |
cd ../test | |
make clean | |
make | |
javac CompareReports.java | |
java CompareReports simple0.log simple0.out | |
java CompareReports simple1.log simple1.out | |
java CompareReports loop0.log loop0.out | |
java CompareReports loop1.log loop1.out | |
java CompareReports branch0.log branch0.out | |
java CompareReports branch1.log branch1.out | |
java CompareReports branch2.log branch2.out | |
java CompareReports cast0.log cast0.out | |
java CompareReports cast1.log cast1.out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment