added better support for structs for extern functions, added a flag to disable list folding and made extern functions automaticly have priority 1
This commit is contained in:
42
extra_tests/c_extern_structs.c
Normal file
42
extra_tests/c_extern_structs.c
Normal file
@@ -0,0 +1,42 @@
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
typedef struct {
|
||||
int64_t a;
|
||||
int64_t b;
|
||||
} Pair;
|
||||
|
||||
typedef struct {
|
||||
int64_t a;
|
||||
int64_t b;
|
||||
int64_t c;
|
||||
} Big;
|
||||
|
||||
long long pair_sum(Pair p) {
|
||||
return (long long)(p.a + p.b);
|
||||
}
|
||||
|
||||
Pair make_pair(long long seed) {
|
||||
Pair out;
|
||||
out.a = seed;
|
||||
out.b = seed + 10;
|
||||
return out;
|
||||
}
|
||||
|
||||
Big make_big(long long seed) {
|
||||
Big out;
|
||||
out.a = seed;
|
||||
out.b = seed + 1;
|
||||
out.c = seed + 2;
|
||||
return out;
|
||||
}
|
||||
|
||||
long long big_sum(Big b) {
|
||||
return b.a + b.b + b.c;
|
||||
}
|
||||
|
||||
long long pair_after_six(long long a, long long b, long long c,
|
||||
long long d, long long e, long long f,
|
||||
Pair p) {
|
||||
return a + b + c + d + e + f + p.a + p.b;
|
||||
}
|
||||
Reference in New Issue
Block a user