If the address of an inline function is taken, a definition for this function must be emitted. However, sparse only do this if this inline function is defined before it is used. So add a testcase for this. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- validation/linear/inline-definition.c | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 validation/linear/inline-definition.c diff --git a/validation/linear/inline-definition.c b/validation/linear/inline-definition.c new file mode 100644 index 000000000000..2918bd5d7527 --- /dev/null +++ b/validation/linear/inline-definition.c @@ -0,0 +1,30 @@ +extern void use(void *); + +static inline int inl0(int a); +static inline int inl1(int a); + +static inline int inl0(int a) +{ + return a; +} + +void foo(void) +{ + use(inl0); + use(inl1); +} + +static inline int inl1(int a) +{ + return a; +} + +/* + * check-name: inline-definition + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-contains: inl0: + * check-output-contains: inl1: + */ -- 2.29.0