mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-14 22:38:46 +00:00
Update skeleton
This commit is contained in:
5
Jenkinsfile
vendored
5
Jenkinsfile
vendored
@@ -39,8 +39,9 @@ pipeline {
|
|||||||
// The stack size of a new thread is `2 MiB` on Linux, and this small stack size
|
// The stack size of a new thread is `2 MiB` on Linux, and this small stack size
|
||||||
// can cause `stack-overflow` error when testing stack-intensive code.
|
// can cause `stack-overflow` error when testing stack-intensive code.
|
||||||
// For this reason, we need to increase the default size of stack to `8 MiB`.
|
// For this reason, we need to increase the default size of stack to `8 MiB`.
|
||||||
sh "RUST_MIN_STACK=8388608 cargo test"
|
// TODO: delete `--skip test_examples_asmgen`
|
||||||
sh "RUST_MIN_STACK=8388608 cargo test --release"
|
sh "RUST_MIN_STACK=8388608 cargo test -- --skip test_examples_asmgen"
|
||||||
|
sh "RUST_MIN_STACK=8388608 cargo test --release -- --skip test_examples_asmgen"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
int fibo(int x) {
|
|
||||||
if (x < 2) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return fibo(x - 1) + fibo(x - 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
int job() {
|
|
||||||
return fibo(25);
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
unsigned long read_cycles()
|
|
||||||
{
|
|
||||||
unsigned long cycles;
|
|
||||||
asm volatile ("rdcycle %0" : "=r" (cycles));
|
|
||||||
return cycles;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern int job();
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
unsigned long start, end;
|
|
||||||
int answer;
|
|
||||||
|
|
||||||
start = read_cycles();
|
|
||||||
answer = job();
|
|
||||||
end = read_cycles();
|
|
||||||
|
|
||||||
printf("cycles: %lu\n", end - start);
|
|
||||||
printf("answer: %d\n", answer);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@ int g_a[5] = {1, 2, 3};
|
|||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
int init = 1;
|
int init = 1;
|
||||||
int a[5] = {init, 2, 3, 4, -5, 6};
|
int a[5] = {init, 2, 3, 4, -5};
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
|
|
||||||
for(int i = 0; i < 5; i++) {
|
for(int i = 0; i < 5; i++) {
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ fn test_examples_deadcode() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: after implementing IR parser, delete `ignore` mark
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_examples_asmgen() {
|
fn test_examples_asmgen() {
|
||||||
test_dir(Path::new("examples/asmgen"), &OsStr::new("ir"), test_asmgen);
|
test_dir(Path::new("examples/asmgen"), &OsStr::new("ir"), test_asmgen);
|
||||||
|
|||||||
Reference in New Issue
Block a user