mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-09-25 05:54:47 +00:00
34 lines
618 B
C
34 lines
618 B
C
|
/*
|
||
|
* Test inline function specifier (C99).
|
||
|
*
|
||
|
* This only tests "static inline" and "extern inline",
|
||
|
* which are the only forms currently supported by ORCA/C.
|
||
|
*/
|
||
|
|
||
|
#include <stdio.h>
|
||
|
|
||
|
static inline int f(void) {
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
inline int extern g(void) {
|
||
|
return 2;
|
||
|
}
|
||
|
|
||
|
int main(void) {
|
||
|
int (*p)(void) = f;
|
||
|
int (*q)(void) = g;
|
||
|
|
||
|
if (f() + g() != 3)
|
||
|
goto Fail;
|
||
|
|
||
|
if (p() + q() != 3)
|
||
|
goto Fail;
|
||
|
|
||
|
printf ("Passed Conformance Test c99inline\n");
|
||
|
return 0;
|
||
|
|
||
|
Fail:
|
||
|
printf ("Failed Conformance Test c99inline\n");
|
||
|
}
|