]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/weak-coalesce.dtest/base.c
6 static bool wasProblem
= false;
7 static const char* coal1Where
= NULL
;
8 static int* coal1Addr
= NULL
;
9 static int checkInCountCoal1
= 0;
11 void baseVerifyCoal1(const char* where
, int* addr
)
13 //fprintf(stderr, "baseVerifyCoal1(%s, %p)\n", where, addr);
15 if ( coal1Where
== NULL
) {
20 if ( addr
!= coal1Addr
) {
21 fprintf(stderr
, "coal1 resolved to different locations. %p in %s and %p in %s\n",
22 coal1Addr
, coal1Where
, addr
, where
);
29 static const char* coal2Where
= NULL
;
30 static int* coal2Addr
= NULL
;
31 static int checkInCountCoal2
= 0;
33 void baseVerifyCoal2(const char* where
, int* addr
)
35 //fprintf(stderr, "baseVerifyCoal2(%s, %p)\n", where, addr);
37 if ( coal2Where
== NULL
) {
42 if ( addr
!= coal2Addr
) {
43 fprintf(stderr
, "coal2 resolved to different locations. %p in %s and %p in %s\n",
44 coal2Addr
, coal2Where
, addr
, where
);
55 printf("[FAIL] weak-coalesce: was problem\n");
56 else if ( checkInCountCoal1
!= 4 )
57 printf("[FAIL] weak-coalesce: checkInCountCoal1 != 4\n");
58 else if ( checkInCountCoal2
!= 4 )
59 printf("[FAIL] weak-coalesce: checkInCountCoal2 != 2\n");
61 printf("[PASS] weak-coalesce\n");