Dan Gohman | fea1dd0 | 2009-08-25 15:38:29 +0000 | [diff] [blame] | 1 | // RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null |
Tanya Lattner | d13e0ae | 2004-11-06 22:29:57 +0000 | [diff] [blame] | 2 | |
Chris Lattner | e11700b | 2003-12-08 06:18:37 +0000 | [diff] [blame] | 3 | struct Evil { |
4 | void fun (); | ||||
5 | }; | ||||
6 | int foo(); | ||||
7 | typedef void (Evil::*memfunptr) (); | ||||
8 | static memfunptr jumpTable[] = { &Evil::fun }; | ||||
9 | |||||
10 | void Evil::fun() { | ||||
11 | (this->*jumpTable[foo()]) (); | ||||
12 | } |