chibicc/test/extern.c

26 lines
326 B
C
Raw Normal View History

2020-09-04 11:27:22 +03:00
#include "test.h"
extern int ext1;
extern int *ext2;
inline int inline_fn(void) {
return 3;
}
2020-09-04 11:27:22 +03:00
int main() {
ASSERT(5, ext1);
ASSERT(5, *ext2);
2020-09-04 12:08:32 +03:00
extern int ext3;
ASSERT(7, ext3);
int ext_fn1(int x);
ASSERT(5, ext_fn1(5));
extern int ext_fn2(int x);
ASSERT(8, ext_fn2(8));
2020-09-04 11:27:22 +03:00
printf("OK\n");
return 0;
}