OSDN Git Service

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