aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn4.c
blob: cd916c981d23c959efe7d698b2ab3800d853684b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* Check that static feature test functions are correctly handled. This
   test case also needs mversn4a.c.  extern_func calls foo and returns 0.*/
   
/* { dg-do run } */
/* { dg-additional-sources "mversn4a.c" } */
/* { dg-options "-O2" } */

#include "mversn4.h"

extern int extern_func ();

int foo ()
{
  return 0;
}

int bar ()
{
  return 1;
}

int __attribute__ ((cold))
main ()
{
  int a = 1, b = 1;
  a  = extern_func ();
  b  = __builtin_dispatch (featureTest, (void *)bar, (void *) foo);
  return a * b;
}