aboutsummaryrefslogtreecommitdiffstats
path: root/test/mppa/instr/framework.h
blob: f43ec616f9b2887e28edc80980b175f40906b2c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef __FRAMEWORK_H__
#define __FRAMEWORK_H__

#include "../prng/prng.c"

int printf(const char *, ...);

#define BEGIN_TEST_N(type, N)\
    int main(void){\
        type t[N], c, i, j, S;\
        srand(0);\
        S = 0;\
        for (i = 0 ; i < 100 ; i++){\
            c = randlong();\
            for (j = 0 ; j < N ; j++)\
                t[j] = randlong();\
    /* END BEGIN_TEST_N */

#define BEGIN_TEST(type)\
    int main(void){\
        type a, b, c, i, S;\
        srand(0);\
        S = 0;\
        for (i = 0 ; i < 100 ; i++){\
            c = randlong();\
            a = randlong();\
            b = randlong();
    /* END BEGIN_TEST */
            
/* In between BEGIN_TEST and END_TEST : definition of c */

#define END_TEST()\
            printf("%llu\n", c);\
            S += c;\
        }\
        return S;\
    }
    /* END END_TEST */

#endif