tests/vg_regtest: Always evaluate prerequisite expressions with sh
[valgrind.git] / memcheck / tests / inltemplate.cpp
blob0d31711920994d2d39a41b3d307ab2df8ad0ed8d
1 #include <stdio.h>
2 #include <valgrind.h>
4 /* GCC 3.4.6 will not compile inlined member template functions.
5 Let's assume GCC 4.x does */
6 #ifdef __GNUC__
7 #if __GNUC__ > 3
8 #define INLINE inline __attribute__((always_inline))
9 #else
10 #define INLINE
11 #endif
12 #endif
14 class X
16 public:
18 template <typename T>
19 static INLINE T temp_member_func_b(T argb) {
20 static T locb = 0;
21 if (argb > 0)
22 locb += argb;
23 return locb;
26 template <typename T>
27 static /*INLINE*/ T temp_member_func_noinline(T arga) {
28 return temp_member_func_b(arga);
34 int main() {
35 int result;
36 result = X::temp_member_func_noinline(result);
37 return 0;