systemtap/tests/Regression/RHEL6Feature-cpp-methods/classes.cpp

72 lines
1.2 KiB
C++
Raw Normal View History

__attribute__((noinline)) void StandaloneFunction(){
}
class CLASS1{
private:
void prMethod() {};
public:
void puMethod() {this->prMethod();};
static void stMethod() {};
};
namespace inner{
void StandaloneFunction(){
}
class CLASS1{
private:
void prMethod() {};
public:
void puMethod() {this->prMethod();};
static void stMethod() {};
};
};
namespace moreinner{
void StandaloneFunction(){
}
class CLASS1{
private:
__attribute__((noinline)) void prMethod() {};
public:
__attribute__((noinline)) void puMethod() {this->prMethod();};
__attribute__((noinline)) static void stMethod() {};
};
};
int main(){
StandaloneFunction();
inner::StandaloneFunction();
moreinner::StandaloneFunction();
CLASS1 A;
inner::CLASS1 B;
moreinner::CLASS1 C;
CLASS1* pA = new CLASS1();
inner::CLASS1 *pB = new inner::CLASS1();
moreinner::CLASS1 *pC = new moreinner::CLASS1();
A.puMethod();
A.stMethod();
B.puMethod();
B.stMethod();
C.puMethod();
C.stMethod();
pA->puMethod();
pA->stMethod();
pB->puMethod();
pB->stMethod();
pC->puMethod();
pC->stMethod();
return 0;
}