Consider used attributes in hidden decls.

Without this patch we would warn and fail to output the function in the test.