 -    for (SmallVectorImpl<IndirectGotoStmt*>::iterator
 -           I = IndirectJumps.begin(), E = IndirectJumps.end(); I != E; ++I) {
 -      IndirectGotoStmt *IG = *I;
-+    llvm::DenseMap<unsigned, Stmt*> JumpScopesMap;
-+    for (SmallVectorImpl<Stmt *>::iterator I = GotoJumps.begin(),
-+                                           E = GotoJumps.end();
++    llvm::DenseMap<unsigned, Stmt*> IndirectJumpScopesMap;
++    llvm::DenseMap<unsigned, Stmt*> AsmJumpScopesMap;
++    for (SmallVectorImpl<Stmt *>::iterator I = IndirectOrAsmJumps.begin(),
++                                           E = IndirectOrAsmJumps.end();
 +         I != E; ++I) {
 +      Stmt *IG = *I;
        if (CHECK_PERMISSIVE(!LabelAndGotoScopes.count(IG)))
          continue;
        unsigned IGScope = LabelAndGotoScopes[IG];
 -      IndirectGotoStmt *&Entry = JumpScopesMap[IGScope];
-+      Stmt *&Entry = JumpScopesMap[IGScope];
-       if (!Entry) Entry = IG;
+-      if (!Entry) Entry = IG;
++      if  (dyn_cast<IndirectGotoStmt>(IG)) {
++        Stmt *&Entry = IndirectJumpScopesMap[IGScope];
++        if (!Entry) Entry = IG;
++      } else {
++        Stmt *&Entry = AsmJumpScopesMap[IGScope];
++        if (!Entry) Entry = IG;
++      }
      }
-     JumpScopes.reserve(JumpScopesMap.size());
+-    JumpScopes.reserve(JumpScopesMap.size());
 -    for (llvm::DenseMap<unsigned, IndirectGotoStmt*>::iterator
 -           I = JumpScopesMap.begin(), E = JumpScopesMap.end(); I != E; ++I)
-+    for (llvm::DenseMap<unsigned, Stmt *>::iterator I = JumpScopesMap.begin(),
-+                                                    E = JumpScopesMap.end();
++    JumpScopes.reserve(IndirectJumpScopesMap.size());
++    for (llvm::DenseMap<unsigned, Stmt *>::iterator
++             I = IndirectJumpScopesMap.begin(),
++             E = IndirectJumpScopesMap.end();
++         I != E; ++I)
++      JumpScopes.push_back(*I);
++    JumpScopes.reserve(AsmJumpScopesMap.size());
++    for (llvm::DenseMap<unsigned, Stmt *>::iterator
++             I = AsmJumpScopesMap.begin(),
++             E = AsmJumpScopesMap.end();
 +         I != E; ++I)
        JumpScopes.push_back(*I);
    }
  
-@@ -685,8 +704,8 @@ void JumpScopeChecker::VerifyIndirectJumps() {
+@@ -685,8 +713,9 @@ void JumpScopeChecker::VerifyIndirectJumps() {
    // label whose address was taken somewhere in the function.
    // For most code bases, there will be only one such scope.
    llvm::DenseMap<unsigned, LabelDecl*> TargetScopes;
 -  for (SmallVectorImpl<LabelDecl*>::iterator
 -         I = IndirectJumpTargets.begin(), E = IndirectJumpTargets.end();
-+  for (SmallVectorImpl<LabelDecl *>::iterator I = JumpTargets.begin(),
-+                                              E = JumpTargets.end();
++  for (SmallVectorImpl<LabelDecl *>::iterator
++           I = IndirectOrAsmJumpTargets.begin(),
++           E = IndirectOrAsmJumpTargets.end();
         I != E; ++I) {
      LabelDecl *TheLabel = *I;
      if (CHECK_PERMISSIVE(!LabelAndGotoScopes.count(TheLabel->getStmt())))
-@@ -763,7 +782,7 @@ void JumpScopeChecker::VerifyIndirectJumps() {
+@@ -763,7 +792,7 @@ void JumpScopeChecker::VerifyIndirectJumps() {
        // Only diagnose if we didn't find something.
        if (IsReachable) continue;
  

-        B, I->scopePosition, JT.scopePosition);
-    appendScopeBegin(JT.block, VD, G);
-    addSuccessor(B, JT.block);
+    if (auto *G = dyn_cast<GotoStmt>(B->getTerminator())) {
+      LabelMapTy::iterator LI = LabelMap.find(G->getLabel());
+      // If there is no target for the goto, then we are looking at an
+      // incomplete AST.  Handle this by not registering a successor.
+      if (LI == LabelMap.end())
+        continue;
+      JumpTarget JT = LI->second;
+      prependAutomaticObjLifetimeWithTerminator(B, I->scopePosition,
+                                                JT.scopePosition);
+      prependAutomaticObjDtorsWithTerminator(B, I->scopePosition,
+                                             JT.scopePosition);
+      const VarDecl *VD = prependAutomaticObjScopeEndWithTerminator(
+          B, I->scopePosition, JT.scopePosition);
+      appendScopeBegin(JT.block, VD, G);
+      addSuccessor(B, JT.block);
+    };
+    if (auto *G = dyn_cast<GCCAsmStmt>(B->getTerminator())) {
+      CFGBlock *Successor  = (I+1)->block;
+      for (auto *L : G->labels()) {
+        LabelMapTy::iterator LI = LabelMap.find(L->getLabel());
+        // If there is no target for the goto, then we are looking at an
+        // incomplete AST.  Handle this by not registering a successor.
+        if (LI == LabelMap.end())
+          continue;
+        JumpTarget JT = LI->second;
+        // Successor has been added, so skip it.
+        if (JT.block == Successor)
+          continue;
+        addSuccessor(B, JT.block);
+      }
+      I++;
+    }
   }
 
   // Add successors to the Indirect Goto Dispatch block (if we have one).
@@ -2099,6 +2116,9 @@ CFGBlock *CFGBuilder::Visit(Stmt * S, AddStmtChoice asc) {
     case Stmt::GotoStmtClass:
       return VisitGotoStmt(cast<GotoStmt>(S));
 

   void CheckJump(Stmt *From, Stmt *To, SourceLocation DiagLoc,
                  unsigned JumpDiag, unsigned JumpDiagWarning,
                  unsigned JumpDiagCXX98Compat);
@@ -103,7 +103,7 @@ JumpScopeChecker::JumpScopeChecker(Stmt *Body, Sema &s)
 
   // Check that all jumps we saw are kosher.
   VerifyJumps();
-  VerifyIndirectJumps();
+  VerifyIndirectOrAsmJumps();
 }
 
 /// GetDeepestCommonScope - Finds the innermost scope enclosing the
@@ -291,7 +291,7 @@ void JumpScopeChecker::BuildScopeInformation(Stmt *S,
   // If we found a label, remember that it is in ParentScope scope.
   switch (S->getStmtClass()) {
   case Stmt::AddrLabelExprClass:
-    IndirectJumpTargets.push_back(cast<AddrLabelExpr>(S)->getLabel());
+    IndirectOrAsmJumpTargets.push_back(cast<AddrLabelExpr>(S)->getLabel());
     break;
 
   case Stmt::ObjCForCollectionStmtClass: {
@@ -316,7 +316,7 @@ void JumpScopeChecker::BuildScopeInformation(Stmt *S,
     }
 
     LabelAndGotoScopes[S] = ParentScope;
-    IndirectJumps.push_back(cast<IndirectGotoStmt>(S));
+    IndirectOrAsmJumps.push_back(S);
     break;
 
   case Stmt::SwitchStmtClass:
@@ -339,6 +339,18 @@ void JumpScopeChecker::BuildScopeInformation(Stmt *S,
     Jumps.push_back(S);
     break;
 
