2022-10-30 00:27:47 +00:00
|
|
|
/*
|
|
|
|
* Test inline function specifier (C99).
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
static inline int f(void) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline int extern g(void) {
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2022-11-20 05:02:50 +00:00
|
|
|
inline int h(int i) {
|
|
|
|
return i+5;
|
|
|
|
}
|
|
|
|
|
2022-10-30 00:27:47 +00:00
|
|
|
int main(void) {
|
|
|
|
int (*p)(void) = f;
|
|
|
|
int (*q)(void) = g;
|
2022-11-20 05:02:50 +00:00
|
|
|
int (*r)(int) = h;
|
2022-10-30 00:27:47 +00:00
|
|
|
|
|
|
|
if (f() + g() != 3)
|
|
|
|
goto Fail;
|
|
|
|
|
|
|
|
if (p() + q() != 3)
|
|
|
|
goto Fail;
|
|
|
|
|
2022-11-20 05:02:50 +00:00
|
|
|
if (h(2) != 7)
|
|
|
|
goto Fail;
|
|
|
|
if (r(23) != 28)
|
|
|
|
goto Fail;
|
|
|
|
|
2022-10-30 00:27:47 +00:00
|
|
|
printf ("Passed Conformance Test c99inline\n");
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
Fail:
|
|
|
|
printf ("Failed Conformance Test c99inline\n");
|
|
|
|
}
|
2022-11-20 05:02:50 +00:00
|
|
|
|
|
|
|
extern inline int h(int i);
|