Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 1 | #ifndef UTILS_H |
| 2 | #define UTILS_H |
| 3 | |
| 4 | inline void break_optimization(void *arg) { |
| 5 | __asm__ __volatile__("" : : "r" (arg) : "memory"); |
| 6 | } |
| 7 | |
| 8 | // Tests will instantiate this class to pad out bit sets to test out the various |
| 9 | // ways we can represent the bit set (32-bit inline, 64-bit inline, memory). |
| 10 | // This class has 37 virtual member functions, which forces us to use a |
| 11 | // pointer-aligned bitset. |
| 12 | template <typename T, unsigned I> |
| 13 | class Deriver : T { |
| 14 | virtual void f() {} |
| 15 | virtual void g() {} |
| 16 | virtual void f1() {} |
| 17 | virtual void f2() {} |
| 18 | virtual void f3() {} |
| 19 | virtual void f4() {} |
| 20 | virtual void f5() {} |
| 21 | virtual void f6() {} |
| 22 | virtual void f7() {} |
| 23 | virtual void f8() {} |
| 24 | virtual void f9() {} |
| 25 | virtual void f10() {} |
| 26 | virtual void f11() {} |
| 27 | virtual void f12() {} |
| 28 | virtual void f13() {} |
| 29 | virtual void f14() {} |
| 30 | virtual void f15() {} |
| 31 | virtual void f16() {} |
| 32 | virtual void f17() {} |
| 33 | virtual void f18() {} |
| 34 | virtual void f19() {} |
| 35 | virtual void f20() {} |
| 36 | virtual void f21() {} |
| 37 | virtual void f22() {} |
| 38 | virtual void f23() {} |
| 39 | virtual void f24() {} |
| 40 | virtual void f25() {} |
| 41 | virtual void f26() {} |
| 42 | virtual void f27() {} |
| 43 | virtual void f28() {} |
| 44 | virtual void f29() {} |
| 45 | virtual void f30() {} |
| 46 | virtual void f31() {} |
| 47 | virtual void f32() {} |
| 48 | virtual void f33() {} |
| 49 | virtual void f34() {} |
| 50 | virtual void f35() {} |
| 51 | }; |
| 52 | |
| 53 | #endif |