Due to statement expressions supported as GCC extension, it is possible
to put 'break' or 'continue' into a loop/switch statement but outside
its body, for example:
for ( ; ({ if (first) { first = 0; continue; } 0; }); )
Such usage must be diagnosed as an error, GCC rejects it. With this
change clang interprets such constructs as GCC in C++ mode: 'break'
and 'continue' in the 3rd expression refer to the loop itself, in
the 1st and 2nd expressions - to outer loop.
This revision is reincarnation of http://llvm-reviews.chandlerc.com/D2018, which was accidentally closed.
This test will not work with a Clang built without asserts, because label names are not emitted into the text form of the IR. If you need to match label names, run the IR through opt -instnamer -S before piping it into FileCheck (see test/CodeGenCXX/for-range.cpp for an example).