]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | #include <stdio.h> // fprintf(), NULL | |
3 | #include <stdlib.h> // exit(), EXIT_SUCCESS | |
4 | ||
5 | #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() | |
6 | ||
7 | // libfoo.dylib has a weak foo[] | |
8 | extern int foo[]; | |
9 | ||
10 | int* pfoo3 = &foo[3]; | |
11 | ||
12 | int main() | |
13 | { | |
14 | if ( *pfoo3 != 4 ) | |
15 | FAIL("weak-in-dylib, pfoo3=%d", *pfoo3); | |
16 | else if ( foo[2] != 3 ) | |
17 | FAIL("weak-in-dylib, foo[2]=%d", foo[2]); | |
18 | else | |
19 | PASS("weak-in-dyliby"); | |
20 | return 0; | |
21 | } | |
22 |