https://llvm.org/bugs/show_bug.cgi?id=20402
Patch by Chris Wailes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235051
91177308-0d34-0410-b5e6-
96231b3b80d8
CurrStates,
WarningsHandler);
- if (BlockInfo.allBackEdgesVisited(*SI, CurrBlock))
+ if (BlockInfo.allBackEdgesVisited(CurrBlock, *SI))
BlockInfo.discardInfo(*SI);
} else {
BlockInfo.addInfo(*SI, CurrStates, OwnershipTaken);
*var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
}
+// Tests if state information is correctly discarded for certain shapes of CFGs.
+void testSwitchGOTO(void) {
+ int a;
+
+ LABEL0:
+ switch (a)
+ case 0:
+ goto LABEL0;
+
+ goto LABEL0;
+}
+
typedef const int*& IntegerPointerReference;
void testIsRValueRefishAndCanonicalType(IntegerPointerReference a) {}