2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / 20021014-1.c
blob1e2b76c761430432f4f63ca01f0d8a0e473da36d
1 /* { dg-do run } */
2 /* { dg-require-profiling "" } */
3 /* { dg-options "-O2 -p" } */
4 /* { dg-options "-O2 -p -static" { target hppa*-*-hpux* } } */
5 /* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */
6 /* { dg-error "" "consider using `-pg' instead of `-p' with gprof(1)" { target *-*-freebsd* } 0 } */
7 /* Support for -p on solaris2 relies on mcrt1.o which comes with the
8 vendor compiler. We cannot reiably predict the directory where the
9 vendor compiler (and thus mcrt1.o) is installed so we can't
10 necessarily find mcrt1.o even if we have it. */
11 /* { dg-error "mcrt1.o" "Optional vendor profiler support missing" { target *-*-solaris2* } 0 } */
12 /* Support for -p on irix relies on libprof1.a which doesn't appear to
13 exist on any irix6 system currently posting testsuite results. */
14 /* { dg-error "libprof1.a" "Profiler support missing" { target mips*-*-irix* } 0 } */
16 extern void abort (void);
17 extern void exit (int);
19 int foo (void)
21 static int bar (int x)
23 return x + 3;
25 return bar (1) + bar (2);
28 int main (void)
30 if (foo () != 9)
31 abort ();
32 exit (0);