]> git.saurik.com Git - apple/dyld.git/blame - unit-tests/test-cases/weak-in-dylib/main.c
dyld-353.2.1.tar.gz
[apple/dyld.git] / unit-tests / test-cases / weak-in-dylib / main.c
CommitLineData
39a8cd10
A
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[]
8extern int foo[];
9
10int* pfoo3 = &foo[3];
11
12int 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