mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 23:18:48 +00:00
Add benchmark
This commit is contained in:
31
bench/exotic_arguments.c
Normal file
31
bench/exotic_arguments.c
Normal file
@@ -0,0 +1,31 @@
|
||||
typedef struct {
|
||||
int a;
|
||||
int b;
|
||||
} small;
|
||||
|
||||
typedef struct {
|
||||
long a;
|
||||
long b;
|
||||
long c;
|
||||
long d;
|
||||
long e;
|
||||
long f;
|
||||
long g;
|
||||
long h;
|
||||
} large;
|
||||
|
||||
int exotic_arguments_struct_small(small a, int nonce) {
|
||||
return a.a + a.b + nonce;
|
||||
}
|
||||
|
||||
long exotic_arguments_struct_large(large a, int nonce) {
|
||||
return a.a + a.b + a.c + a.d + a.e + a.f + a.g + a.h + nonce;
|
||||
}
|
||||
|
||||
float exotic_arguments_float(float a, int nonce) {
|
||||
return a + (float) nonce;
|
||||
}
|
||||
|
||||
double exotic_arguments_double(double a, int nonce) {
|
||||
return a + (double) nonce;
|
||||
}
|
||||
Reference in New Issue
Block a user