I assume Thumb2 is the name of the processor's machine language (or assembly language) instruction set????
I've never tried it...
I think you have to check your compiler's documentation. Look for "assembly". "ASSEMBLER", or "ASM". I don't have my C/C++ references handy, and I don't remember if this is part of the ISO/ANSI language standard, or if it's optional. (If you program purely in assembly, then technically you use an assembler instead of a compiler.)
I found [u]this[/u] for the arduino/AVR processor.
I believe it gets rather tricky when you combine C/C++ with assembly because you have to save the state of the processor (internal registers, etc.) and restore them before returning to your C/C++ program. Maybe the compiler sometimes takes care of that, but I'm not sure.