Added primitive support for the ISO C99 inline feature as well as the __inline__ extension.

No inlining is actually done but that part is not required by the standard.
This commit is contained in:
acqn
2024-01-14 00:08:41 +08:00
parent a173428fab
commit 0b06c34dfc
13 changed files with 184 additions and 12 deletions

20
test/val/inline-func.c Normal file
View File

@@ -0,0 +1,20 @@
/* C99 inline */
#include <stdlib.h>
inline static int f(int x, ...)
{
return x * 2;
}
extern inline int g(int x);
int main(void)
{
return f(g(7)) == 42 ? EXIT_SUCCESS : EXIT_FAILURE;
}
int g(int x)
{
return x * 3;
}