| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -fdump-tree-lsplit-details" } */ |
| 3 |
/* { dg-skip-if "requires hosted libstdc++ for string" { ! hostedlib } } */ |
| 4 |
|
| 5 |
#include <string> |
| 6 |
#include <map> |
| 7 |
|
| 8 |
using namespace std; |
| 9 |
|
| 10 |
class A |
| 11 |
{ |
| 12 |
public: |
| 13 |
bool empty; |
| 14 |
void set (string s); |
| 15 |
}; |
| 16 |
|
| 17 |
class B |
| 18 |
{ |
| 19 |
map<int, string> m; |
| 20 |
void f (); |
| 21 |
}; |
| 22 |
|
| 23 |
extern A *ga; |
| 24 |
|
| 25 |
void B::f () |
| 26 |
{ |
| 27 |
for (map<int, string>::iterator iter = m.begin (); iter != m.end (); ++iter) |
| 28 |
{ |
| 29 |
if (ga->empty) |
| 30 |
ga->set (iter->second); |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
/* { dg-final { scan-tree-dump-times "loop split on semi-invariant condition at false branch" 1 "lsplit" } } */ |