Switch + Addresses of functions

Is it possible to use address of function in case block of switch instruction? I understand that it should be constants only, but in llvm reference i founded that: "The addresses of global variables and functions are always implicitly valid (link-time) constants. "

Yours sincerely,
Kadysev Mikhail

Hi Михаил,

Is it possible to use address of function in case block of switch instruction?

no.

  I

understand that it should be constants only

They have to be simple numbers.

, but in llvm reference i founded

that: "The addresses of global variables
<http://llvm.org/docs/LangRef.html#globalvars>and functions
<http://llvm.org/docs/LangRef.html#functionstructure>are always implicitly valid
(link-time) constants. "

Maybe you are looking for the indirectbr instruction?

Ciao, Duncan.