]> git.saurik.com Git - apple/dyld.git/blame - unit-tests/test-cases/upward-dylib-init-order/common.c
dyld-360.22.tar.gz
[apple/dyld.git] / unit-tests / test-cases / upward-dylib-init-order / common.c
CommitLineData
832b6fce
A
1#include "common.h"
2#include <stdio.h>
3
4static bool b = false;
5static bool u = false;
19894a12 6static bool u2 = false;
832b6fce
A
7static bool isOk = true;
8
9void setB()
10{
19894a12 11 if ( u || b || u2 )
832b6fce
A
12 isOk = false;
13 b = true;
14}
15
16void setU()
17{
19894a12 18 if ( u || u2 )
832b6fce
A
19 isOk = false;
20 u = true;
21}
22
19894a12
A
23void setU2()
24{
25 if ( u2 )
26 isOk = false;
27 u2 = true;
28}
29
832b6fce
A
30// return true iff
31// setB() was called, then setU()
32bool ok()
33{
34 //fprintf(stderr, "isOk=%d, u=%d, b=%d\n", isOk, u, b);
19894a12 35 return isOk && u && b && u2;
832b6fce
A
36}
37