Skip to content
Snippets Groups Projects
Commit f7378df1 authored by Matthew McGill's avatar Matthew McGill
Browse files

Changed cicd test structure

parent 75faaebc
No related branches found
No related tags found
No related merge requests found
Showing
with 136 additions and 5 deletions
File moved
File moved
File moved
File moved
File moved
File moved
#include <stdio.h>
extern int fib();
extern int fib2();
extern int fibp(int n, int (*)(int,int));
int add(int n1, int n2)
{
if (n1 == 0)
return n2;
else if (n2 == 0)
return n1;
else if (n1 == 2)
return add(1, add(1, n2));
else
return n1 + add(0, n2);
}
main(int argc, char **argv)
{
int x = 3;
int f = 0;
if (argc >= 2)
x = atoi(argv[1]);
if (x <= 2)
f = fib_main(x);
if (x == 3)
f = fib2(x);
else if (x == 4)
f = fib_simple(x);
else if (x == 5)
f = fibp(x, &add);
else
f = fib(x);
printf("Fibonacci(%d) = %d\n", x, f);
return f;
}
fib_main(int f) {
if (f <= 2)
return 1;
else
return fib_simple(f-1) + fib_main(f-2);
}
fib_simple(int f) {
if (f <= 2)
return 1;
else
return fib_simple(f-1) + fib_simple(f-2);
}
#include <stdlib.h>
#include <stdio.h>
extern int foo();
int main()
{
foo();
}
int foo2()
{
printf("In foo2\n");
}
File moved
File moved
extern int fib_main();
extern int fib2();
extern int fib2p(int n, int (*)(int,int));
int add2(int n1, int n2)
{
if (n1 == 0)
return n2;
else if (n2 == 0)
return n1;
else if (n2 == 2)
return add2(add2(n1, 1),1);
else
return add2(0, n2) + add2(n1, 0);
}
int fib(int n)
{
if (n <= 2)
return 1;
else
return fib_main(n-1) + fib2(n-2);
}
int fibp(int n, int (*addp)(int,int))
{
if (n <= 2)
return 1;
else
return (*addp)(fib_main(n-1),fib2p(n-2,&add2));
}
extern int fib_main();
extern int fib();
int fib2(int n)
{
if (n <= 2)
return 1;
else
return fib2(n-1) + fib_main(n-2);
}
int fib2p(int n, int (*addp)(int,int))
{
if (n <= 2)
return (*addp)(1,0);
else
return (*addp)(fib2(n-1),fib2p(n-2, addp));
}
#include <math.h>
#include <stdio.h>
#include <stdint.h>
int bar()
{
printf("in bar\n");
}
int foo()
{
printf("in foo\n");
foo2();
}
File moved
File moved
#!/bin/bash
source cfi_all_configs.sh
source ../cfi_all_configs.sh
get_correct()
{
......
#!/bin/bash
source cfi_all_configs.sh
source ../cfi_smokescreen_configs.sh
get_correct()
{
......
#!/bin/bash
source cfi_smokescreen_configs.sh
source ../cfi_smokescreen_configs.sh
get_correct()
{
......
......@@ -3,7 +3,7 @@
libcpath=""
source cfi_all_configs.sh
source ../cfi_all_configs.sh
get_correct()
......
#!/bin/bash
source cfi_all_configs.sh
source ../cfi_all_configs.sh
get_correct()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment