/* test more complex weak stuff. Both weak symbols and weak external symbols. */ #include extern int bar1; extern int bar2; extern int bar3; extern int bar4; extern int bar5; extern int bar6; int main() { int i; int cErrors = 0; i = foo(); if (i != 1) { printf("foo() returned %d, exepcted 1\n", i); cErrors++; } i = foo3(); if (i != 1) { printf("foo3() returned %d, exepcted 1\n", i); cErrors++; } i = foo4(); if (i != -1) { printf("foo4() returned %d, exepcted -1\n", i); cErrors++; } i = foo5(); if (i != 1) { printf("foo5() returned %d, exepcted 1\n", i); cErrors++; } i = foo6(); if (i != 12) { printf("foo6() returned %d, exepcted 12\n", i); cErrors++; } i = bar1 + bar2 + bar3 + bar4 + bar5 + bar6; if (i != 21) { printf("bar sum is %d exepcted 21\n", i); cErrors++; } return cErrors; }