Fix gcc.c-torture/execute/ieee/cdivchkf.c on hpux
[official-gcc.git] / libvtv / testsuite / libvtv.cc / bb_tests.cc
blob2a2447d02c89132785d50bc410f05deb7b502e2c
1 // { dg-do run }
2 struct base
4 int total;
5 virtual void add (int i) { total += i; }
6 virtual void sub (int i) { total -= i; }
7 virtual void init (void) { total = 73; }
8 };
10 struct derived : public base
12 int total;
13 virtual void add (int i) { total += 10 * i; }
14 virtual void sub (int i) { total -= 2 * i; }
15 virtual void init (void) { total = 0; }
18 bool
19 get_cond_value (int x)
21 if ((x % 3) > 0)
22 return true;
23 else
24 return false;
26 return false;
29 int
30 main (int argc, char **argv)
32 base *a;
33 bool cond_value = get_cond_value (10);
34 int x;
36 if (cond_value)
37 a = new base ();
38 else
39 a = new derived ();
41 cond_value = get_cond_value (47);
42 x = 0;
43 if (!cond_value)
44 x = 17;
46 a->init ();
48 for ( ; x < 10; ++x)
50 a->add(50);
51 a->sub(25);