tests: Check for GCC when using typeof()

It's a GCC extension; any other compiler, except Clang in GCC
compatibility mode, will need to opt it if they support it.