ignore invalid DOF provider sections
[binutils-gdb.git] / gdb / testsuite / gdb.cp / method.cc
blob949b027a02e31846da730d2bf6e0b17103da7643
1 // Class funk has a constructor and an ordinary method
2 // Test for CHFts23426
4 class funk
6 public:
7 funk();
8 void getFunky(int a, int b);
9 int data_;
12 funk::funk()
13 : data_(33)
17 void funk::getFunky(int a, int b)
19 int res;
20 res = a + b - data_;
21 data_ = res;
24 // Class A has const and volatile methods
26 class A {
27 public:
28 int x;
29 int y;
30 int foo (int arg);
31 int bar (int arg) const;
32 int baz (int arg, char c) volatile;
33 int qux (int arg, float f) const volatile;
36 int A::foo (int arg)
38 x += arg;
39 return arg *2;
42 int A::bar (int arg) const
44 return arg + 2 * x;
47 int A::baz (int arg, char c) volatile
49 return arg - 2 * x + c;
52 int A::qux (int arg, float f) const volatile
54 if (f > 0)
55 return 2 * arg - x;
56 else
57 return 2 * arg + x;
61 int main()
63 A a;
64 int k;
66 k = 10;
67 a.x = k * 2;
69 k = a.foo(13);
71 k += a.bar(15);
73 // Test for CHFts23426 follows
74 funk f;
75 f.getFunky(1, 2);
76 return 0;