2014-02-05 Balaji V. Iyer <balaji.v.iyer@intel.com>
[official-gcc.git] / gcc / testsuite / g++.dg / pr49718.C
blobd7f2710a994474f6122e754b652cca9d81e6024b
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -finstrument-functions" } */
3 /* { dg-additional-options "-mno-explicit-relocs" { target alpha*-*-* } } */
4 /* { dg-additional-options "-mno-relax-pic-calls" { target mips*-*-* } } */
5 /* { dg-final { scan-assembler-times "__cyg_profile_func_enter" 1} } */
7 #define NOINSTR __attribute__((no_instrument_function))
9 struct t
11    public:
12        /* Function code should be instrumented */
13        __attribute__((noinline)) t() {}
15        /* Function t::a() should not be instrumented */
16        NOINSTR void a(){
17        }
18        /* Function t::b() should not be instrumented */
19        void NOINSTR b(){
20        }
21        /* Function t::c() should not be instrumented */
22        void c() NOINSTR {
23        }
24        /* Function t::d() should not be instrumented */
25        void d() NOINSTR;
28 void t::d()
32 /* Function call_all_functions() should not be instrumented */
33 struct t call_all_functions() __attribute__((no_instrument_function));
34 struct t call_all_functions()
36        struct t a;     /* Constructor not inlined */
37        a.a();          /* Inlined t::a() should not be instrumented */
38        a.b();          /* Inlined t::b() should not be instrumented */
39        a.c();          /* Inlined t::c() should not be instrumented */
40        a.d();          /* Inlined t::d() should not be instrumented */
41        return a;