]> git.saurik.com Git - apple/dyld.git/blobdiff - unit-tests/test-cases/flat-prebound/foo.c
dyld-95.3.tar.gz
[apple/dyld.git] / unit-tests / test-cases / flat-prebound / foo.c
index 5f951e814885573b4b09e713d3acf8e157671016..f47a91afe8af15a749390842bd0a1a75e5aeef21 100644 (file)
  * 
  * @APPLE_LICENSE_HEADER_END@
  */
+#include <stdbool.h>
 
 extern int bar();
+extern int barVar;
+extern int barVar2;
 
-int foo()
+int* myBarVar = &barVar;
+
+
+bool foo()
 {
-       return bar();
+       // test non-lazy pointer
+       if ( barVar2 != 0 )
+               return false;
+
+       // test external relocation
+       if ( *myBarVar != 0 )
+               return false;
+       
+       // test lazy pointer
+       if ( bar() != 0 )
+               return false;
+               
+       return true;
 }