How to specify thumb2, arm7 or arm8 mode for function by __attribute__

Hello,
I need to compile one function in thumb-2 mode, keeping all others in arm mode.
I can’t find any example how to do this. With gcc it’s easy with attribute((target(‘thumb’))).

Thank you.