| 1 |
// Test case for the dumb plugin. |
| 2 |
// { dg-do compile } |
| 3 |
// { dg-options "-O -fplugin-arg-dumb_plugin-ref-pass-name=ccp -fplugin-arg-dumb_plugin-ref-pass-instance-num=1" } |
| 4 |
|
| 5 |
class Foo { |
| 6 |
private: |
| 7 |
int a_; |
| 8 |
|
| 9 |
public: |
| 10 |
Foo() : a_(a_) {} // { dg-warning "Before genericizing function" } |
| 11 |
|
| 12 |
void setA(int a) { |
| 13 |
a_ = a_; |
| 14 |
} // { dg-warning "Before genericizing function" } |
| 15 |
|
| 16 |
void operator=(Foo& rhs) { |
| 17 |
this->a_ = rhs.a_; |
| 18 |
} // { dg-warning "Before genericizing function" } |
| 19 |
}; // { dg-warning "Process struct Foo" } |
| 20 |
|
| 21 |
struct Bar { |
| 22 |
int b_; |
| 23 |
int c_; |
| 24 |
}; // { dg-warning "Process struct Bar" } |
| 25 |
|
| 26 |
int g = g; |
| 27 |
Foo foo = foo; |
| 28 |
|
| 29 |
void func() |
| 30 |
{ |
| 31 |
Bar *bar1, bar2; |
| 32 |
Foo local_foo; |
| 33 |
int x = x; |
| 34 |
static int y = y; |
| 35 |
float *f; |
| 36 |
Bar bar_array[5]; |
| 37 |
char n; |
| 38 |
int overflow; |
| 39 |
|
| 40 |
*f = *f; |
| 41 |
bar1->b_ = bar1->b_; |
| 42 |
bar2.c_ = bar2.c_; |
| 43 |
local_foo = local_foo; |
| 44 |
foo = foo; |
| 45 |
foo.setA(5); |
| 46 |
bar_array[3].c_ = bar_array[3].c_; |
| 47 |
bar_array[x+g].b_ = bar_array[x+g].b_; |
| 48 |
y = x; |
| 49 |
x = y; |
| 50 |
} // { dg-warning "Before genericizing function" } |
| 51 |
|
| 52 |
// { dg-warning "Analyze function" "" { target *-*-* } 50 } |
| 53 |
// { dg-warning "End of compilation unit" "" { target *-*-* } 50 } |