[llvm-branch-commits] [cfe-branch] r148545 [3/3] - in /cfe/branches/tooling: ./ bindings/python/clang/ docs/ examples/PrintFunctionNames/ examples/clang-interpreter/ include/clang-c/ include/clang/AST/ include/clang/Analysis/ include/clang/Analysis/Analyses/ include/clang/Analysis/Visitors/ include/clang/Basic/ include/clang/CodeGen/ include/clang/Driver/ include/clang/Frontend/ include/clang/Lex/ include/clang/Parse/ include/clang/Sema/ include/clang/Serialization/ include/clang/StaticAnalyzer/Core/ include/clang/StaticAnaly...

Manuel Klimek klimek at google.com
Fri Jan 20 08:14:26 PST 2012


Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp Fri Jan 20 10:14:22 2012
@@ -22,12 +22,13 @@
                                           ExplodedNode *Pred,
                                           ExplodedNodeSet &Dst) {
   const ProgramState *state = Pred->getState();
-  SVal baseVal = state->getSVal(Ex->getBase());
+  const LocationContext *LCtx = Pred->getLocationContext();
+  SVal baseVal = state->getSVal(Ex->getBase(), LCtx);
   SVal location = state->getLValue(Ex->getDecl(), baseVal);
   
   ExplodedNodeSet dstIvar;
   StmtNodeBuilder Bldr(Pred, dstIvar, *currentBuilderContext);
-  Bldr.generateNode(Ex, Pred, state->BindExpr(Ex, location));
+  Bldr.generateNode(Ex, Pred, state->BindExpr(Ex, LCtx, location));
   
   // Perform the post-condition check of the ObjCIvarRefExpr and store
   // the created nodes in 'Dst'.
@@ -80,7 +81,7 @@
     elementV = state->getLValue(elemD, Pred->getLocationContext());
   }
   else {
-    elementV = state->getSVal(elem);
+    elementV = state->getSVal(elem, Pred->getLocationContext());
   }
   
   ExplodedNodeSet dstLocation;
@@ -92,14 +93,15 @@
        NE = dstLocation.end(); NI!=NE; ++NI) {
     Pred = *NI;
     const ProgramState *state = Pred->getState();
+    const LocationContext *LCtx = Pred->getLocationContext();
     
     // Handle the case where the container still has elements.
     SVal TrueV = svalBuilder.makeTruthVal(1);
-    const ProgramState *hasElems = state->BindExpr(S, TrueV);
+    const ProgramState *hasElems = state->BindExpr(S, LCtx, TrueV);
     
     // Handle the case where the container has no elements.
     SVal FalseV = svalBuilder.makeTruthVal(0);
-    const ProgramState *noElems = state->BindExpr(S, FalseV);
+    const ProgramState *noElems = state->BindExpr(S, LCtx, FalseV);
     
     if (loc::MemRegionVal *MV = dyn_cast<loc::MemRegionVal>(&elementV))
       if (const TypedValueRegion *R = 
@@ -146,7 +148,7 @@
     
     if (const Expr *Receiver = msg.getInstanceReceiver()) {
       const ProgramState *state = Pred->getState();
-      SVal recVal = state->getSVal(Receiver);
+      SVal recVal = state->getSVal(Receiver, Pred->getLocationContext());
       if (!recVal.isUndef()) {
         // Bifurcate the state into nil and non-nil ones.
         DefinedOrUnknownSVal receiverVal = cast<DefinedOrUnknownSVal>(recVal);
@@ -241,7 +243,7 @@
     // These methods return their receivers.
     const Expr *ReceiverE = msg.getInstanceReceiver();
     if (ReceiverE)
-      ReturnValue = state->getSVal(ReceiverE);
+      ReturnValue = state->getSVal(ReceiverE, Pred->getLocationContext());
     break;
   }
   }
@@ -256,11 +258,11 @@
   }
 
   // Bind the return value.
-  state = state->BindExpr(currentStmt, ReturnValue);
+  const LocationContext *LCtx = Pred->getLocationContext();
+  state = state->BindExpr(currentStmt, LCtx, ReturnValue);
 
   // Invalidate the arguments (and the receiver)
-  const LocationContext *LC = Pred->getLocationContext();
-  state = invalidateArguments(state, CallOrObjCMessage(msg, state), LC);
+  state = invalidateArguments(state, CallOrObjCMessage(msg, state, LCtx), LCtx);
 
   // And create the new node.
   Bldr.generateNode(msg.getOriginExpr(), Pred, state, GenSink);

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/MemRegion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/MemRegion.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/MemRegion.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/MemRegion.cpp Fri Jan 20 10:14:22 2012
@@ -19,6 +19,7 @@
 #include "clang/Analysis/Support/BumpVector.h"
 #include "clang/AST/CharUnits.h"
 #include "clang/AST/RecordLayout.h"
+#include "clang/Basic/SourceManager.h"
 #include "llvm/Support/raw_ostream.h"
 
 using namespace clang;
@@ -384,6 +385,20 @@
 }
 
 //===----------------------------------------------------------------------===//
+// Region anchors.
+//===----------------------------------------------------------------------===//
+
+void GlobalsSpaceRegion::anchor() { }
+void HeapSpaceRegion::anchor() { }
+void UnknownSpaceRegion::anchor() { }
+void StackLocalsSpaceRegion::anchor() { }
+void StackArgumentsSpaceRegion::anchor() { }
+void TypedRegion::anchor() { }
+void TypedValueRegion::anchor() { }
+void CodeTextRegion::anchor() { }
+void SubRegion::anchor() { }
+
+//===----------------------------------------------------------------------===//
 // Region pretty-printing.
 //===----------------------------------------------------------------------===//
 
@@ -445,10 +460,6 @@
   os << superRegion << "->" << *getDecl();
 }
 
-void NonStaticGlobalSpaceRegion::dumpToStream(raw_ostream &os) const {
-  os << "NonStaticGlobalSpaceRegion";
-}
-
 void ObjCIvarRegion::dumpToStream(raw_ostream &os) const {
   os << "ivar{" << superRegion << ',' << *getDecl() << '}';
 }
@@ -477,6 +488,22 @@
   os << "StaticGlobalsMemSpace{" << CR << '}';
 }
 
+void NonStaticGlobalSpaceRegion::dumpToStream(raw_ostream &os) const {
+  os << "NonStaticGlobalSpaceRegion";
+}
+
+void GlobalInternalSpaceRegion::dumpToStream(raw_ostream &os) const {
+  os << "GlobalInternalSpaceRegion";
+}
+
+void GlobalSystemSpaceRegion::dumpToStream(raw_ostream &os) const {
+  os << "GlobalSystemSpaceRegion";
+}
+
+void GlobalImmutableSpaceRegion::dumpToStream(raw_ostream &os) const {
+  os << "GlobalImmutableSpaceRegion";
+}
+
 //===----------------------------------------------------------------------===//
 // MemRegionManager methods.
 //===----------------------------------------------------------------------===//
@@ -528,10 +555,18 @@
 }
 
 const GlobalsSpaceRegion
-*MemRegionManager::getGlobalsRegion(const CodeTextRegion *CR) {
-  if (!CR)
-    return LazyAllocate(globals);
+*MemRegionManager::getGlobalsRegion(MemRegion::Kind K,
+                                    const CodeTextRegion *CR) {
+  if (!CR) {
+    if (K == MemRegion::GlobalSystemSpaceRegionKind)
+      return LazyAllocate(SystemGlobals);
+    if (K == MemRegion::GlobalImmutableSpaceRegionKind)
+      return LazyAllocate(ImmutableGlobals);
+    assert(K == MemRegion::GlobalInternalSpaceRegionKind);
+    return LazyAllocate(InternalGlobals);
+  }
 
+  assert(K == MemRegion::StaticGlobalSpaceRegionKind);
   StaticGlobalSpaceRegion *&R = StaticsGlobalSpaceRegions[CR];
   if (R)
     return R;
@@ -556,7 +591,6 @@
 //===----------------------------------------------------------------------===//
 // Constructing regions.
 //===----------------------------------------------------------------------===//
-
 const StringRegion* MemRegionManager::getStringRegion(const StringLiteral* Str){
   return getSubRegion<StringRegion>(Str, getGlobalsRegion());
 }
@@ -565,9 +599,31 @@
                                                 const LocationContext *LC) {
   const MemRegion *sReg = 0;
 
-  if (D->hasGlobalStorage() && !D->isStaticLocal())
-    sReg = getGlobalsRegion();
-  else {
+  if (D->hasGlobalStorage() && !D->isStaticLocal()) {
+
+    // First handle the globals defined in system headers.
+    if (C.getSourceManager().isInSystemHeader(D->getLocation())) {
+      // Whitelist the system globals which often DO GET modified, assume the
+      // rest are immutable.
+      if (D->getName().find("errno") != StringRef::npos)
+        sReg = getGlobalsRegion(MemRegion::GlobalSystemSpaceRegionKind);
+      else
+        sReg = getGlobalsRegion(MemRegion::GlobalImmutableSpaceRegionKind);
+
+    // Treat other globals as GlobalInternal unless they are constants.
+    } else {
+      QualType GQT = D->getType();
+      const Type *GT = GQT.getTypePtrOrNull();
+      // TODO: We could walk the complex types here and see if everything is
+      // constified.
+      if (GT && GQT.isConstQualified() && GT->isArithmeticType())
+        sReg = getGlobalsRegion(MemRegion::GlobalImmutableSpaceRegionKind);
+      else
+        sReg = getGlobalsRegion();
+    }
+  
+  // Finally handle static locals.  
+  } else {
     // FIXME: Once we implement scope handling, we will need to properly lookup
     // 'D' to the proper LocationContext.
     const DeclContext *DC = D->getDeclContext();
@@ -585,13 +641,15 @@
         assert(D->isStaticLocal());
         const Decl *D = STC->getDecl();
         if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
-          sReg = getGlobalsRegion(getFunctionTextRegion(FD));
+          sReg = getGlobalsRegion(MemRegion::StaticGlobalSpaceRegionKind,
+                                  getFunctionTextRegion(FD));
         else if (const BlockDecl *BD = dyn_cast<BlockDecl>(D)) {
           const BlockTextRegion *BTR =
             getBlockTextRegion(BD,
                      C.getCanonicalType(BD->getSignatureAsWritten()->getType()),
                      STC->getAnalysisDeclContext());
-          sReg = getGlobalsRegion(BTR);
+          sReg = getGlobalsRegion(MemRegion::StaticGlobalSpaceRegionKind,
+                                  BTR);
         }
         else {
           // FIXME: For ObjC-methods, we need a new CodeTextRegion.  For now

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/ObjCMessage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/ObjCMessage.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/ObjCMessage.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/ObjCMessage.cpp Fri Jan 20 10:14:22 2012
@@ -13,6 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h"
+#include "clang/AST/DeclCXX.h"
 
 using namespace clang;
 using namespace ento;
@@ -124,7 +125,7 @@
 
     isLVal = FunctionCall->isLValue();
     const Expr *Callee = FunctionCall->getCallee();
-    if (const FunctionDecl *FD = State->getSVal(Callee).getAsFunctionDecl())
+    if (const FunctionDecl *FD = State->getSVal(Callee, LCtx).getAsFunctionDecl())
       resultTy = FD->getResultType();
     else
       resultTy = FunctionCall->getType();
@@ -140,7 +141,7 @@
   assert(isFunctionCall());
   assert(!isCXXCall());
   const Expr *Fun = CallE.get<const CallExpr *>()->getCallee()->IgnoreParens();
-  return State->getSVal(Fun);
+  return State->getSVal(Fun, LCtx);
 }
 
 SVal CallOrObjCMessage::getCXXCallee() const {
@@ -154,7 +155,7 @@
   if (!callee)
     return UnknownVal();
   
-  return State->getSVal(callee);
+  return State->getSVal(callee, LCtx);
 }
 
 SVal
@@ -162,3 +163,21 @@
   assert(isObjCMessage());
   return Msg.getInstanceReceiverSVal(State, LC);
 }
+
+const Decl *CallOrObjCMessage::getDecl() const {
+  if (isCXXCall()) {
+    const CXXMemberCallExpr *CE =
+        cast<CXXMemberCallExpr>(CallE.dyn_cast<const CallExpr *>());
+    assert(CE);
+    return CE->getMethodDecl();
+  } else if (isObjCMessage()) {
+    return Msg.getMethodDecl();
+  } else if (isFunctionCall()) {
+    // In case of a C style call, use the path sensitive information to find
+    // the function declaration.
+    SVal CalleeVal = getFunctionCallee();
+    return CalleeVal.getAsFunctionDecl();
+  }
+  return 0;
+}
+

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/PathDiagnostic.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/PathDiagnostic.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/PathDiagnostic.cpp Fri Jan 20 10:14:22 2012
@@ -82,6 +82,8 @@
     Desc(StripTrailingDots(desc)),
     Category(StripTrailingDots(category)) {}
 
+void PathDiagnosticConsumer::anchor() { }
+
 void PathDiagnosticConsumer::HandlePathDiagnostic(const PathDiagnostic *D) {
   // For now this simply forwards to HandlePathDiagnosticImpl.  In the future
   // we can use this indirection to control for multi-threaded access to
@@ -235,9 +237,15 @@
     case RangeK:
       break;
     case StmtK:
+      // Defensive checking.
+      if (!S)
+        break;
       return FullSourceLoc(getValidSourceLocation(S, LAC),
                            const_cast<SourceManager&>(*SM));
     case DeclK:
+      // Defensive checking.
+      if (!D)
+        break;
       return FullSourceLoc(D->getLocation(), const_cast<SourceManager&>(*SM));
   }
 

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp Fri Jan 20 10:14:22 2012
@@ -379,7 +379,7 @@
   std::string ErrMsg;
   llvm::raw_fd_ostream o(OutputFile.c_str(), ErrMsg);
   if (!ErrMsg.empty()) {
-    llvm::errs() << "warning: could not creat file: " << OutputFile << '\n';
+    llvm::errs() << "warning: could not create file: " << OutputFile << '\n';
     return;
   }
 

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/ProgramState.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/ProgramState.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/ProgramState.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/ProgramState.cpp Fri Jan 20 10:14:22 2012
@@ -136,20 +136,20 @@
 ProgramState::invalidateRegions(ArrayRef<const MemRegion *> Regions,
                                 const Expr *E, unsigned Count,
                                 StoreManager::InvalidatedSymbols *IS,
-                                bool invalidateGlobals) const {
+                                const CallOrObjCMessage *Call) const {
   if (!IS) {
     StoreManager::InvalidatedSymbols invalidated;
     return invalidateRegionsImpl(Regions, E, Count,
-                                 invalidated, invalidateGlobals);
+                                 invalidated, Call);
   }
-  return invalidateRegionsImpl(Regions, E, Count, *IS, invalidateGlobals);
+  return invalidateRegionsImpl(Regions, E, Count, *IS, Call);
 }
 
 const ProgramState *
 ProgramState::invalidateRegionsImpl(ArrayRef<const MemRegion *> Regions,
                                     const Expr *E, unsigned Count,
                                     StoreManager::InvalidatedSymbols &IS,
-                                    bool invalidateGlobals) const {
+                                    const CallOrObjCMessage *Call) const {
   ProgramStateManager &Mgr = getStateManager();
   SubEngine* Eng = Mgr.getOwningEngine();
  
@@ -157,14 +157,14 @@
     StoreManager::InvalidatedRegions Invalidated;
     const StoreRef &newStore
       = Mgr.StoreMgr->invalidateRegions(getStore(), Regions, E, Count, IS,
-                                        invalidateGlobals, &Invalidated);
+                                        Call, &Invalidated);
     const ProgramState *newState = makeWithStore(newStore);
     return Eng->processRegionChanges(newState, &IS, Regions, Invalidated);
   }
 
   const StoreRef &newStore =
     Mgr.StoreMgr->invalidateRegions(getStore(), Regions, E, Count, IS,
-                                    invalidateGlobals, NULL);
+                                    Call, NULL);
   return makeWithStore(newStore);
 }
 
@@ -180,9 +180,11 @@
   return makeWithStore(newStore);
 }
 
-const ProgramState *ProgramState::enterStackFrame(const StackFrameContext *frame) const {
+const ProgramState *
+ProgramState::enterStackFrame(const LocationContext *callerCtx,
+                              const StackFrameContext *calleeCtx) const {
   const StoreRef &new_store =
-    getStateManager().StoreMgr->enterStackFrame(this, frame);
+    getStateManager().StoreMgr->enterStackFrame(this, callerCtx, calleeCtx);
   return makeWithStore(new_store);
 }
 
@@ -239,9 +241,12 @@
   return V;
 }
 
-const ProgramState *ProgramState::BindExpr(const Stmt *S, SVal V, bool Invalidate) const{
-  Environment NewEnv = getStateManager().EnvMgr.bindExpr(Env, S, V,
-                                                         Invalidate);
+const ProgramState *ProgramState::BindExpr(const Stmt *S,
+                                           const LocationContext *LCtx,
+                                           SVal V, bool Invalidate) const{
+  Environment NewEnv =
+    getStateManager().EnvMgr.bindExpr(Env, EnvironmentEntry(S, LCtx), V,
+                                      Invalidate);
   if (NewEnv == Env)
     return this;
 
@@ -250,10 +255,14 @@
   return getStateManager().getPersistentState(NewSt);
 }
 
-const ProgramState *ProgramState::bindExprAndLocation(const Stmt *S, SVal location,
-                                            SVal V) const {
+const ProgramState *
+ProgramState::bindExprAndLocation(const Stmt *S, const LocationContext *LCtx,
+                                  SVal location,
+                                  SVal V) const {
   Environment NewEnv =
-    getStateManager().EnvMgr.bindExprAndLocation(Env, S, location, V);
+    getStateManager().EnvMgr.bindExprAndLocation(Env,
+                                                 EnvironmentEntry(S, LCtx),
+                                                 location, V);
 
   if (NewEnv == Env)
     return this;
@@ -380,114 +389,44 @@
 //  State pretty-printing.
 //===----------------------------------------------------------------------===//
 
-static bool IsEnvLoc(const Stmt *S) {
-  // FIXME: This is a layering violation.  Should be in environment.
-  return (bool) (((uintptr_t) S) & 0x1);
-}
-
-void ProgramState::print(raw_ostream &Out, CFG *C,
+void ProgramState::print(raw_ostream &Out,
                          const char *NL, const char *Sep) const {
   // Print the store.
   ProgramStateManager &Mgr = getStateManager();
   Mgr.getStoreManager().print(getStore(), Out, NL, Sep);
-  bool isFirst = true;
-
-  // FIXME: All environment printing should be moved inside Environment.
-  if (C) {
-    // Print Subexpression bindings.
-    for (Environment::iterator I = Env.begin(), E = Env.end(); I != E; ++I) {
-      if (C->isBlkExpr(I.getKey()) || IsEnvLoc(I.getKey()))
-        continue;
-
-      if (isFirst) {
-        Out << NL << NL << "Sub-Expressions:" << NL;
-        isFirst = false;
-      } else {
-        Out << NL;
-      }
-
-      Out << " (" << (void*) I.getKey() << ") ";
-      LangOptions LO; // FIXME.
-      I.getKey()->printPretty(Out, 0, PrintingPolicy(LO));
-      Out << " : " << I.getData();
-    }
-
-    // Print block-expression bindings.
-    isFirst = true;
-    for (Environment::iterator I = Env.begin(), E = Env.end(); I != E; ++I) {
-      if (!C->isBlkExpr(I.getKey()))
-        continue;
-
-      if (isFirst) {
-        Out << NL << NL << "Block-level Expressions:" << NL;
-        isFirst = false;
-      } else {
-        Out << NL;
-      }
-
-      Out << " (" << (void*) I.getKey() << ") ";
-      LangOptions LO; // FIXME.
-      I.getKey()->printPretty(Out, 0, PrintingPolicy(LO));
-      Out << " : " << I.getData();
-    }
-  } else {
-    // Print All bindings - no info to differentiate block from subexpressions.
-    for (Environment::iterator I = Env.begin(), E = Env.end(); I != E; ++I) {
-      if (IsEnvLoc(I.getKey()))
-        continue;
-
-      if (isFirst) {
-        Out << NL << NL << "Expressions:" << NL;
-        isFirst = false;
-      } else {
-        Out << NL;
-      }
-
-      Out << " (" << (void*) I.getKey() << ") ";
-      LangOptions LO; // FIXME.
-      I.getKey()->printPretty(Out, 0, PrintingPolicy(LO));
-      Out << " : " << I.getData();
-    }
-  }
-
-  // Print locations.
-  isFirst = true;
-  
-  for (Environment::iterator I = Env.begin(), E = Env.end(); I != E; ++I) {
-    if (!IsEnvLoc(I.getKey()))
-      continue;
-    
-    if (isFirst) {
-      Out << NL << NL << "Load/store locations:" << NL;
-      isFirst = false;
-    } else {
-      Out << NL;
-    }
 
-    const Stmt *S = (Stmt*) (((uintptr_t) I.getKey()) & ((uintptr_t) ~0x1));
-    
-    Out << " (" << (void*) S << ") ";
-    LangOptions LO; // FIXME.
-    S->printPretty(Out, 0, PrintingPolicy(LO));
-    Out << " : " << I.getData();
-  }
+  // Print out the environment.
+  Env.print(Out, NL, Sep);
 
+  // Print out the constraints.
   Mgr.getConstraintManager().print(this, Out, NL, Sep);
 
   // Print checker-specific data.
   Mgr.getOwningEngine()->printState(Out, this, NL, Sep);
 }
 
-void ProgramState::printDOT(raw_ostream &Out, CFG &C) const {
-  print(Out, &C, "\\l", "\\|");
+void ProgramState::printDOT(raw_ostream &Out) const {
+  print(Out, "\\l", "\\|");
 }
 
-void ProgramState::dump(CFG &C) const {
-  print(llvm::errs(), &C);
+void ProgramState::dump() const {
+  print(llvm::errs());
 }
 
-void ProgramState::dump() const {
-  print(llvm::errs(), 0);
+void ProgramState::printTaint(raw_ostream &Out,
+                              const char *NL, const char *Sep) const {
+  TaintMapImpl TM = get<TaintMap>();
+
+  if (!TM.isEmpty())
+    Out <<"Tainted Symbols:" << NL;
+
+  for (TaintMapImpl::iterator I = TM.begin(), E = TM.end(); I != E; ++I) {
+    Out << I->first << " : " << I->second << NL;
+  }
+}
+
+void ProgramState::dumpTaint() const {
+  printTaint(llvm::errs());
 }
 
 //===----------------------------------------------------------------------===//
@@ -536,6 +475,8 @@
   return getPersistentState(NewState);
 }
 
+void ScanReachableSymbols::anchor() { }
+
 bool ScanReachableSymbols::scan(nonloc::CompoundVal val) {
   for (nonloc::CompoundVal::iterator I=val.begin(), E=val.end(); I!=E; ++I)
     if (!scan(*I))
@@ -652,15 +593,16 @@
 }
 
 const ProgramState* ProgramState::addTaint(const Stmt *S,
+                                           const LocationContext *LCtx,
                                            TaintTagType Kind) const {
   if (const Expr *E = dyn_cast_or_null<Expr>(S))
     S = E->IgnoreParens();
 
-  SymbolRef Sym = getSVal(S).getAsSymbol();
+  SymbolRef Sym = getSVal(S, LCtx).getAsSymbol();
   if (Sym)
     return addTaint(Sym, Kind);
 
-  const MemRegion *R = getSVal(S).getAsRegion();
+  const MemRegion *R = getSVal(S, LCtx).getAsRegion();
   addTaint(R, Kind);
 
   // Cannot add taint, so just return the state.
@@ -676,16 +618,22 @@
 
 const ProgramState* ProgramState::addTaint(SymbolRef Sym,
                                            TaintTagType Kind) const {
+  // If this is a symbol cast, remove the cast before adding the taint. Taint
+  // is cast agnostic.
+  while (const SymbolCast *SC = dyn_cast<SymbolCast>(Sym))
+    Sym = SC->getOperand();
+
   const ProgramState *NewState = set<TaintMap>(Sym, Kind);
   assert(NewState);
   return NewState;
 }
 
-bool ProgramState::isTainted(const Stmt *S, TaintTagType Kind) const {
+bool ProgramState::isTainted(const Stmt *S, const LocationContext *LCtx,
+                             TaintTagType Kind) const {
   if (const Expr *E = dyn_cast_or_null<Expr>(S))
     S = E->IgnoreParens();
 
-  SVal val = getSVal(S);
+  SVal val = getSVal(S, LCtx);
   return isTainted(val, Kind);
 }
 
@@ -715,7 +663,7 @@
   return false;
 }
 
-bool ProgramState::isTainted(const SymExpr* Sym, TaintTagType Kind) const {
+bool ProgramState::isTainted(SymbolRef Sym, TaintTagType Kind) const {
   if (!Sym)
     return false;
   
@@ -735,6 +683,10 @@
     if (const SymbolRegionValue *SRV = dyn_cast<SymbolRegionValue>(*SI))
       Tainted = Tainted || isTainted(SRV->getRegion(), Kind);
 
+    // If If this is a SymbolCast from a tainted value, it's also tainted.
+    if (const SymbolCast *SC = dyn_cast<SymbolCast>(*SI))
+      Tainted = Tainted || isTainted(SC->getOperand(), Kind);
+
     if (Tainted)
       return true;
   }

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/RegionStore.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/RegionStore.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/RegionStore.cpp Fri Jan 20 10:14:22 2012
@@ -20,6 +20,7 @@
 #include "clang/Analysis/Analyses/LiveVariables.h"
 #include "clang/Analysis/AnalysisContext.h"
 #include "clang/Basic/TargetInfo.h"
+#include "clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h"
@@ -235,11 +236,16 @@
   //===-------------------------------------------------------------------===//
   // Binding values to regions.
   //===-------------------------------------------------------------------===//
+  RegionBindings invalidateGlobalRegion(MemRegion::Kind K,
+                                        const Expr *Ex,
+                                        unsigned Count,
+                                        RegionBindings B,
+                                        InvalidatedRegions *Invalidated);
 
   StoreRef invalidateRegions(Store store, ArrayRef<const MemRegion *> Regions,
                              const Expr *E, unsigned Count,
                              InvalidatedSymbols &IS,
-                             bool invalidateGlobals,
+                             const CallOrObjCMessage *Call,
                              InvalidatedRegions *Invalidated);
 
 public:   // Made public for helper classes.
@@ -273,7 +279,8 @@
     RegionBindings B = GetRegionBindings(store);
     assert(!lookup(B, R, BindingKey::Default));
     assert(!lookup(B, R, BindingKey::Direct));
-    return StoreRef(addBinding(B, R, BindingKey::Default, V).getRootWithoutRetain(), *this);
+    return StoreRef(addBinding(B, R, BindingKey::Default, V)
+                      .getRootWithoutRetain(), *this);
   }
 
   StoreRef BindCompoundLiteral(Store store, const CompoundLiteralExpr *CL,
@@ -308,12 +315,10 @@
   
   bool includedInBindings(Store store, const MemRegion *region) const;
 
-  //===------------------------------------------------------------------===//
-  // Loading values from regions.
-  //===------------------------------------------------------------------===//
-
+  /// \brief Return the value bound to specified location in a given state.
+  ///
   /// The high level logic for this method is this:
-  /// Retrieve (L)
+  /// getBinding (L)
   ///   if L has binding
   ///     return L's binding
   ///   else if L is in killset
@@ -323,39 +328,39 @@
   ///       return undefined
   ///     else
   ///       return symbolic
-  SVal Retrieve(Store store, Loc L, QualType T = QualType());
+  SVal getBinding(Store store, Loc L, QualType T = QualType());
 
-  SVal RetrieveElement(Store store, const ElementRegion *R);
+  SVal getBindingForElement(Store store, const ElementRegion *R);
 
-  SVal RetrieveField(Store store, const FieldRegion *R);
+  SVal getBindingForField(Store store, const FieldRegion *R);
 
-  SVal RetrieveObjCIvar(Store store, const ObjCIvarRegion *R);
+  SVal getBindingForObjCIvar(Store store, const ObjCIvarRegion *R);
 
-  SVal RetrieveVar(Store store, const VarRegion *R);
+  SVal getBindingForVar(Store store, const VarRegion *R);
 
-  SVal RetrieveLazySymbol(const TypedValueRegion *R);
+  SVal getBindingForLazySymbol(const TypedValueRegion *R);
 
-  SVal RetrieveFieldOrElementCommon(Store store, const TypedValueRegion *R,
-                                    QualType Ty, const MemRegion *superR);
+  SVal getBindingForFieldOrElementCommon(Store store, const TypedValueRegion *R,
+                                         QualType Ty, const MemRegion *superR);
   
-  SVal RetrieveLazyBinding(const MemRegion *lazyBindingRegion,
-                           Store lazyBindingStore);
+  SVal getLazyBinding(const MemRegion *lazyBindingRegion,
+                      Store lazyBindingStore);
 
-  /// Retrieve the values in a struct and return a CompoundVal, used when doing
-  /// struct copy:
+  /// Get bindings for the values in a struct and return a CompoundVal, used
+  /// when doing struct copy:
   /// struct s x, y;
   /// x = y;
   /// y's value is retrieved by this method.
-  SVal RetrieveStruct(Store store, const TypedValueRegion* R);
+  SVal getBindingForStruct(Store store, const TypedValueRegion* R);
 
-  SVal RetrieveArray(Store store, const TypedValueRegion* R);
+  SVal getBindingForArray(Store store, const TypedValueRegion* R);
 
   /// Used to lazily generate derived symbols for bindings that are defined
   ///  implicitly by default bindings in a super region.
-  Optional<SVal> RetrieveDerivedDefaultValue(RegionBindings B,
-                                             const MemRegion *superR,
-                                             const TypedValueRegion *R, 
-                                             QualType Ty);
+  Optional<SVal> getBindingForDerivedDefaultValue(RegionBindings B,
+                                                  const MemRegion *superR,
+                                                  const TypedValueRegion *R,
+                                                  QualType Ty);
 
   /// Get the state and region whose binding this region R corresponds to.
   std::pair<Store, const MemRegion*>
@@ -375,7 +380,8 @@
                               SymbolReaper& SymReaper);
 
   StoreRef enterStackFrame(const ProgramState *state,
-                           const StackFrameContext *frame);
+                           const LocationContext *callerCtx,
+                           const StackFrameContext *calleeCtx);
 
   //===------------------------------------------------------------------===//
   // Region "extents".
@@ -422,7 +428,8 @@
   return new RegionStoreManager(StMgr, F);
 }
 
-StoreManager *ento::CreateFieldsOnlyRegionStoreManager(ProgramStateManager &StMgr) {
+StoreManager *
+ento::CreateFieldsOnlyRegionStoreManager(ProgramStateManager &StMgr) {
   RegionStoreFeatures F = minimal_features_tag();
   F.enableFields(true);
   return new RegionStoreManager(StMgr, F);
@@ -713,20 +720,44 @@
   }
   
 
-  DefinedOrUnknownSVal V = svalBuilder.getConjuredSymbolVal(baseR, Ex, T, Count);
+  DefinedOrUnknownSVal V = svalBuilder.getConjuredSymbolVal(baseR, Ex, T,Count);
   assert(SymbolManager::canSymbolicate(T) || V.isUnknown());
   B = RM.addBinding(B, baseR, BindingKey::Direct, V);
 }
 
+RegionBindings RegionStoreManager::invalidateGlobalRegion(MemRegion::Kind K,
+                                                          const Expr *Ex,
+                                                          unsigned Count,
+                                                          RegionBindings B,
+                                            InvalidatedRegions *Invalidated) {
+  // Bind the globals memory space to a new symbol that we will use to derive
+  // the bindings for all globals.
+  const GlobalsSpaceRegion *GS = MRMgr.getGlobalsRegion(K);
+  SVal V =
+      svalBuilder.getConjuredSymbolVal(/* SymbolTag = */ (void*) GS, Ex,
+          /* symbol type, doesn't matter */ Ctx.IntTy,
+          Count);
+
+  B = removeBinding(B, GS);
+  B = addBinding(B, BindingKey::Make(GS, BindingKey::Default), V);
+
+  // Even if there are no bindings in the global scope, we still need to
+  // record that we touched it.
+  if (Invalidated)
+    Invalidated->push_back(GS);
+
+  return B;
+}
+
 StoreRef RegionStoreManager::invalidateRegions(Store store,
                                             ArrayRef<const MemRegion *> Regions,
                                                const Expr *Ex, unsigned Count,
                                                InvalidatedSymbols &IS,
-                                               bool invalidateGlobals,
+                                               const CallOrObjCMessage *Call,
                                               InvalidatedRegions *Invalidated) {
   invalidateRegionsWorker W(*this, StateMgr,
                             RegionStoreManager::GetRegionBindings(store),
-                            Ex, Count, IS, Invalidated, invalidateGlobals);
+                            Ex, Count, IS, Invalidated, false);
 
   // Scan the bindings and generate the clusters.
   W.GenerateClusters();
@@ -741,20 +772,20 @@
   // Return the new bindings.
   RegionBindings B = W.getRegionBindings();
 
-  if (invalidateGlobals) {
-    // Bind the non-static globals memory space to a new symbol that we will
-    // use to derive the bindings for all non-static globals.
-    const GlobalsSpaceRegion *GS = MRMgr.getGlobalsRegion();
-    SVal V =
-      svalBuilder.getConjuredSymbolVal(/* SymbolTag = */ (void*) GS, Ex,
-                                  /* symbol type, doesn't matter */ Ctx.IntTy,
-                                  Count);
-    B = addBinding(B, BindingKey::Make(GS, BindingKey::Default), V);
-
-    // Even if there are no bindings in the global scope, we still need to
-    // record that we touched it.
-    if (Invalidated)
-      Invalidated->push_back(GS);
+  // For all globals which are not static nor immutable: determine which global
+  // regions should be invalidated and invalidate them.
+  // TODO: This could possibly be more precise with modules.
+  //
+  // System calls invalidate only system globals.
+  if (Call && Call->isInSystemHeader()) {
+    B = invalidateGlobalRegion(MemRegion::GlobalSystemSpaceRegionKind,
+                               Ex, Count, B, Invalidated);
+  // Internal calls might invalidate both system and internal globals.
+  } else {
+    B = invalidateGlobalRegion(MemRegion::GlobalSystemSpaceRegionKind,
+                               Ex, Count, B, Invalidated);
+    B = invalidateGlobalRegion(MemRegion::GlobalInternalSpaceRegionKind,
+                               Ex, Count, B, Invalidated);
   }
 
   return StoreRef(B.getRootWithoutRetain(), *this);
@@ -764,9 +795,10 @@
 // Extents for regions.
 //===----------------------------------------------------------------------===//
 
-DefinedOrUnknownSVal RegionStoreManager::getSizeInElements(const ProgramState *state,
-                                                           const MemRegion *R,
-                                                           QualType EleTy) {
+DefinedOrUnknownSVal
+RegionStoreManager::getSizeInElements(const ProgramState *state,
+                                      const MemRegion *R,
+                                      QualType EleTy) {
   SVal Size = cast<SubRegion>(R)->getExtent(svalBuilder);
   const llvm::APSInt *SizeInt = svalBuilder.getKnownValue(state, Size);
   if (!SizeInt)
@@ -863,7 +895,7 @@
   return Optional<SVal>();
 }
 
-SVal RegionStoreManager::Retrieve(Store store, Loc L, QualType T) {
+SVal RegionStoreManager::getBinding(Store store, Loc L, QualType T) {
   assert(!isa<UnknownVal>(L) && "location unknown");
   assert(!isa<UndefinedVal>(L) && "location undefined");
 
@@ -886,8 +918,12 @@
       isa<SymbolicRegion>(MR) ||
       isa<CodeTextRegion>(MR)) {
     if (T.isNull()) {
-      const SymbolicRegion *SR = cast<SymbolicRegion>(MR);
-      T = SR->getSymbol()->getType(Ctx);
+      if (const TypedRegion *TR = dyn_cast<TypedRegion>(MR))
+        T = TR->getLocationType();
+      else {
+        const SymbolicRegion *SR = cast<SymbolicRegion>(MR);
+        T = SR->getSymbol()->getType(Ctx);
+      }
     }
     MR = GetElementZeroRegion(MR, T);
   }
@@ -907,21 +943,21 @@
   // Such funny addressing will occur due to layering of regions.
 
   if (RTy->isStructureOrClassType())
-    return RetrieveStruct(store, R);
+    return getBindingForStruct(store, R);
 
   // FIXME: Handle unions.
   if (RTy->isUnionType())
     return UnknownVal();
 
   if (RTy->isArrayType())
-    return RetrieveArray(store, R);
+    return getBindingForArray(store, R);
 
   // FIXME: handle Vector types.
   if (RTy->isVectorType())
     return UnknownVal();
 
   if (const FieldRegion* FR = dyn_cast<FieldRegion>(R))
-    return CastRetrievedVal(RetrieveField(store, FR), FR, T, false);
+    return CastRetrievedVal(getBindingForField(store, FR), FR, T, false);
 
   if (const ElementRegion* ER = dyn_cast<ElementRegion>(R)) {
     // FIXME: Here we actually perform an implicit conversion from the loaded
@@ -929,7 +965,7 @@
     // more intelligently.  For example, an 'element' can encompass multiple
     // bound regions (e.g., several bound bytes), or could be a subset of
     // a larger value.
-    return CastRetrievedVal(RetrieveElement(store, ER), ER, T, false);
+    return CastRetrievedVal(getBindingForElement(store, ER), ER, T, false);
   }
 
   if (const ObjCIvarRegion *IVR = dyn_cast<ObjCIvarRegion>(R)) {
@@ -939,7 +975,7 @@
     // reinterpretted, it is possible we stored a different value that could
     // fit within the ivar.  Either we need to cast these when storing them
     // or reinterpret them lazily (as we do here).
-    return CastRetrievedVal(RetrieveObjCIvar(store, IVR), IVR, T, false);
+    return CastRetrievedVal(getBindingForObjCIvar(store, IVR), IVR, T, false);
   }
 
   if (const VarRegion *VR = dyn_cast<VarRegion>(R)) {
@@ -949,7 +985,7 @@
     // variable is reinterpretted, it is possible we stored a different value
     // that could fit within the variable.  Either we need to cast these when
     // storing them or reinterpret them lazily (as we do here).
-    return CastRetrievedVal(RetrieveVar(store, VR), VR, T, false);
+    return CastRetrievedVal(getBindingForVar(store, VR), VR, T, false);
   }
 
   RegionBindings B = GetRegionBindings(store);
@@ -1019,7 +1055,7 @@
   return std::make_pair((Store) 0, (const MemRegion *) 0);
 }
 
-SVal RegionStoreManager::RetrieveElement(Store store,
+SVal RegionStoreManager::getBindingForElement(Store store,
                                          const ElementRegion* R) {
   // Check if the region has a binding.
   RegionBindings B = GetRegionBindings(store);
@@ -1041,7 +1077,7 @@
     if (nonloc::ConcreteInt *CI = dyn_cast<nonloc::ConcreteInt>(&Idx)) {
       int64_t i = CI->getValue().getSExtValue();
       // Abort on string underrun.  This can be possible by arbitrary
-      // clients of RetrieveElement().
+      // clients of getBindingForElement().
       if (i < 0)
         return UndefinedVal();
       int64_t length = Str->getLength();
@@ -1091,10 +1127,11 @@
       }
     }
   }
-  return RetrieveFieldOrElementCommon(store, R, R->getElementType(), superR);
+  return getBindingForFieldOrElementCommon(store, R, R->getElementType(),
+                                           superR);
 }
 
-SVal RegionStoreManager::RetrieveField(Store store,
+SVal RegionStoreManager::getBindingForField(Store store,
                                        const FieldRegion* R) {
 
   // Check if the region has a binding.
@@ -1103,14 +1140,14 @@
     return *V;
 
   QualType Ty = R->getValueType();
-  return RetrieveFieldOrElementCommon(store, R, Ty, R->getSuperRegion());
+  return getBindingForFieldOrElementCommon(store, R, Ty, R->getSuperRegion());
 }
 
 Optional<SVal>
-RegionStoreManager::RetrieveDerivedDefaultValue(RegionBindings B,
-                                                const MemRegion *superR,
-                                                const TypedValueRegion *R,
-                                                QualType Ty) {
+RegionStoreManager::getBindingForDerivedDefaultValue(RegionBindings B,
+                                                     const MemRegion *superR,
+                                                     const TypedValueRegion *R,
+                                                     QualType Ty) {
 
   if (const Optional<SVal> &D = getDefaultBinding(B, superR)) {
     const SVal &val = D.getValue();
@@ -1133,28 +1170,28 @@
   return Optional<SVal>();
 }
 
-SVal RegionStoreManager::RetrieveLazyBinding(const MemRegion *lazyBindingRegion,
+SVal RegionStoreManager::getLazyBinding(const MemRegion *lazyBindingRegion,
                                              Store lazyBindingStore) {
   if (const ElementRegion *ER = dyn_cast<ElementRegion>(lazyBindingRegion))
-    return RetrieveElement(lazyBindingStore, ER);
+    return getBindingForElement(lazyBindingStore, ER);
   
-  return RetrieveField(lazyBindingStore,
-                       cast<FieldRegion>(lazyBindingRegion));
+  return getBindingForField(lazyBindingStore,
+                            cast<FieldRegion>(lazyBindingRegion));
 }
                                         
-SVal RegionStoreManager::RetrieveFieldOrElementCommon(Store store,
+SVal RegionStoreManager::getBindingForFieldOrElementCommon(Store store,
                                                       const TypedValueRegion *R,
                                                       QualType Ty,
                                                       const MemRegion *superR) {
 
-  // At this point we have already checked in either RetrieveElement or
-  // RetrieveField if 'R' has a direct binding.
+  // At this point we have already checked in either getBindingForElement or
+  // getBindingForField if 'R' has a direct binding.
 
   RegionBindings B = GetRegionBindings(store);
 
   while (superR) {
     if (const Optional<SVal> &D =
-        RetrieveDerivedDefaultValue(B, superR, R, Ty))
+        getBindingForDerivedDefaultValue(B, superR, R, Ty))
       return *D;
 
     // If our super region is a field or element itself, walk up the region
@@ -1172,7 +1209,7 @@
   llvm::tie(lazyBindingStore, lazyBindingRegion) = GetLazyBinding(B, R, R);
 
   if (lazyBindingRegion)
-    return RetrieveLazyBinding(lazyBindingRegion, lazyBindingStore);
+    return getLazyBinding(lazyBindingRegion, lazyBindingStore);
 
   if (R->hasStackNonParametersStorage()) {
     if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) {
@@ -1197,7 +1234,8 @@
   return svalBuilder.getRegionValueSymbolVal(R);
 }
 
-SVal RegionStoreManager::RetrieveObjCIvar(Store store, const ObjCIvarRegion* R){
+SVal RegionStoreManager::getBindingForObjCIvar(Store store,
+                                               const ObjCIvarRegion* R) {
 
     // Check if the region has a binding.
   RegionBindings B = GetRegionBindings(store);
@@ -1216,10 +1254,10 @@
     return UnknownVal();
   }
 
-  return RetrieveLazySymbol(R);
+  return getBindingForLazySymbol(R);
 }
 
-SVal RegionStoreManager::RetrieveVar(Store store, const VarRegion *R) {
+SVal RegionStoreManager::getBindingForVar(Store store, const VarRegion *R) {
 
   // Check if the region has a binding.
   RegionBindings B = GetRegionBindings(store);
@@ -1251,7 +1289,8 @@
           }
       }
 
-      if (const Optional<SVal> &V = RetrieveDerivedDefaultValue(B, MS, R, CT))
+      if (const Optional<SVal> &V
+            = getBindingForDerivedDefaultValue(B, MS, R, CT))
         return V.getValue();
 
       return svalBuilder.getRegionValueSymbolVal(R);
@@ -1268,19 +1307,18 @@
   return UndefinedVal();
 }
 
-SVal RegionStoreManager::RetrieveLazySymbol(const TypedValueRegion *R) {
+SVal RegionStoreManager::getBindingForLazySymbol(const TypedValueRegion *R) {
   // All other values are symbolic.
   return svalBuilder.getRegionValueSymbolVal(R);
 }
 
-SVal RegionStoreManager::RetrieveStruct(Store store, 
+SVal RegionStoreManager::getBindingForStruct(Store store, 
                                         const TypedValueRegion* R) {
-  QualType T = R->getValueType();
-  assert(T->isStructureOrClassType());
+  assert(R->getValueType()->isStructureOrClassType());
   return svalBuilder.makeLazyCompoundVal(StoreRef(store, *this), R);
 }
 
-SVal RegionStoreManager::RetrieveArray(Store store, 
+SVal RegionStoreManager::getBindingForArray(Store store, 
                                        const TypedValueRegion * R) {
   assert(Ctx.getAsConstantArrayType(R->getValueType()));
   return svalBuilder.makeLazyCompoundVal(StoreRef(store, *this), R);
@@ -1644,7 +1682,8 @@
   const StackFrameContext *CurrentLCtx;
 
 public:
-  removeDeadBindingsWorker(RegionStoreManager &rm, ProgramStateManager &stateMgr,
+  removeDeadBindingsWorker(RegionStoreManager &rm,
+                           ProgramStateManager &stateMgr,
                            RegionBindings b, SymbolReaper &symReaper,
                            const StackFrameContext *LCtx)
     : ClusterAnalysis<removeDeadBindingsWorker>(rm, stateMgr, b,
@@ -1820,36 +1859,40 @@
 
 
 StoreRef RegionStoreManager::enterStackFrame(const ProgramState *state,
-                                             const StackFrameContext *frame) {
-  FunctionDecl const *FD = cast<FunctionDecl>(frame->getDecl());
+                                             const LocationContext *callerCtx,
+                                             const StackFrameContext *calleeCtx)
+{
+  FunctionDecl const *FD = cast<FunctionDecl>(calleeCtx->getDecl());
   FunctionDecl::param_const_iterator PI = FD->param_begin(), 
                                      PE = FD->param_end();
   StoreRef store = StoreRef(state->getStore(), *this);
 
-  if (CallExpr const *CE = dyn_cast<CallExpr>(frame->getCallSite())) {
+  if (CallExpr const *CE = dyn_cast<CallExpr>(calleeCtx->getCallSite())) {
     CallExpr::const_arg_iterator AI = CE->arg_begin(), AE = CE->arg_end();
 
     // Copy the arg expression value to the arg variables.  We check that
     // PI != PE because the actual number of arguments may be different than
     // the function declaration.
     for (; AI != AE && PI != PE; ++AI, ++PI) {
-      SVal ArgVal = state->getSVal(*AI);
+      SVal ArgVal = state->getSVal(*AI, callerCtx);
       store = Bind(store.getStore(),
-                   svalBuilder.makeLoc(MRMgr.getVarRegion(*PI, frame)), ArgVal);
+                   svalBuilder.makeLoc(MRMgr.getVarRegion(*PI, calleeCtx)),
+                   ArgVal);
     }
   } else if (const CXXConstructExpr *CE =
-               dyn_cast<CXXConstructExpr>(frame->getCallSite())) {
+               dyn_cast<CXXConstructExpr>(calleeCtx->getCallSite())) {
     CXXConstructExpr::const_arg_iterator AI = CE->arg_begin(),
       AE = CE->arg_end();
 
     // Copy the arg expression value to the arg variables.
     for (; AI != AE; ++AI, ++PI) {
-      SVal ArgVal = state->getSVal(*AI);
+      SVal ArgVal = state->getSVal(*AI, callerCtx);
       store = Bind(store.getStore(),
-                   svalBuilder.makeLoc(MRMgr.getVarRegion(*PI,frame)), ArgVal);
+                   svalBuilder.makeLoc(MRMgr.getVarRegion(*PI, calleeCtx)),
+                   ArgVal);
     }
   } else
-    assert(isa<CXXDestructorDecl>(frame->getDecl()));
+    assert(isa<CXXDestructorDecl>(calleeCtx->getDecl()));
 
   return store;
 }

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/SValBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/SValBuilder.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/SValBuilder.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/SValBuilder.cpp Fri Jan 20 10:14:22 2012
@@ -25,6 +25,8 @@
 // Basic SVal creation.
 //===----------------------------------------------------------------------===//
 
+void SValBuilder::anchor() { }
+
 DefinedOrUnknownSVal SValBuilder::makeZeroVal(QualType type) {
   if (Loc::isLocType(type))
     return makeNull();
@@ -229,14 +231,41 @@
                                               Context.IntTy));
 }
 
+/// Recursively check if the pointer types are equal modulo const, volatile,
+/// and restrict qualifiers. Assumes the input types are canonical.
+/// TODO: This is based off of code in SemaCast; can we reuse it.
+static bool haveSimilarTypes(ASTContext &Context, QualType T1,
+                                                  QualType T2) {
+  while (Context.UnwrapSimilarPointerTypes(T1, T2)) {
+    Qualifiers Quals1, Quals2;
+    T1 = Context.getUnqualifiedArrayType(T1, Quals1);
+    T2 = Context.getUnqualifiedArrayType(T2, Quals2);
+
+    // Make sure that non cvr-qualifiers the other qualifiers (e.g., address
+    // spaces) are identical.
+    Quals1.removeCVRQualifiers();
+    Quals2.removeCVRQualifiers();
+    if (Quals1 != Quals2)
+      return false;
+  }
+
+  if (T1 != T2)
+    return false;
+
+  return true;
+}
+
 // FIXME: should rewrite according to the cast kind.
 SVal SValBuilder::evalCast(SVal val, QualType castTy, QualType originalTy) {
+  castTy = Context.getCanonicalType(castTy);
+  originalTy = Context.getCanonicalType(originalTy);
   if (val.isUnknownOrUndef() || castTy == originalTy)
     return val;
 
   // For const casts, just propagate the value.
   if (!castTy->isVariableArrayType() && !originalTy->isVariableArrayType())
-    if (Context.hasSameUnqualifiedType(castTy, originalTy))
+    if (haveSimilarTypes(Context, Context.getPointerType(castTy),
+                                  Context.getPointerType(originalTy)))
       return val;
   
   // Check for casts from pointers to integers.

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/SVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/SVals.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/SVals.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/SVals.cpp Fri Jan 20 10:14:22 2012
@@ -245,8 +245,6 @@
     case UndefinedKind:
       os << "Undefined";
       break;
-    default:
-      assert (false && "Invalid SVal.");
   }
 }
 

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/Store.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/Store.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/Store.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/Store.cpp Fri Jan 20 10:14:22 2012
@@ -23,7 +23,8 @@
     MRMgr(svalBuilder.getRegionManager()), Ctx(stateMgr.getContext()) {}
 
 StoreRef StoreManager::enterStackFrame(const ProgramState *state,
-                                       const StackFrameContext *frame) {
+                                       const LocationContext *callerCtx,
+                                       const StackFrameContext *calleeCtx) {
   return StoreRef(state->getStore(), *this);
 }
 
@@ -101,8 +102,10 @@
     case MemRegion::StackArgumentsSpaceRegionKind:
     case MemRegion::HeapSpaceRegionKind:
     case MemRegion::UnknownSpaceRegionKind:
-    case MemRegion::NonStaticGlobalSpaceRegionKind:
-    case MemRegion::StaticGlobalSpaceRegionKind: {
+    case MemRegion::StaticGlobalSpaceRegionKind:
+    case MemRegion::GlobalInternalSpaceRegionKind:
+    case MemRegion::GlobalSystemSpaceRegionKind:
+    case MemRegion::GlobalImmutableSpaceRegionKind: {
       llvm_unreachable("Invalid region cast");
     }
 
@@ -331,3 +334,5 @@
 
 StoreManager::BindingsHandler::~BindingsHandler() {}
 
+void SubRegionMap::anchor() { }
+void SubRegionMap::Visitor::anchor() { }

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/SymbolManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/SymbolManager.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/SymbolManager.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/SymbolManager.cpp Fri Jan 20 10:14:22 2012
@@ -21,6 +21,8 @@
 using namespace clang;
 using namespace ento;
 
+void SymExpr::anchor() { }
+
 void SymExpr::dump() const {
   dumpToStream(llvm::errs());
 }
@@ -99,6 +101,8 @@
      << getRegion() << ',' << T.getAsString() << '}';
 }
 
+void SymbolData::anchor() { }
+
 void SymbolRegionValue::dumpToStream(raw_ostream &os) const {
   os << "reg_$" << getSymbolID() << "<" << R << ">";
 }
@@ -487,7 +491,16 @@
   return isa<SymbolRegionValue>(sym);
 }
 
-bool SymbolReaper::isLive(const Stmt *ExprVal) const {
+bool
+SymbolReaper::isLive(const Stmt *ExprVal, const LocationContext *ELCtx) const {
+  if (LCtx != ELCtx) {
+    // If the reaper's location context is a parent of the expression's
+    // location context, then the expression value is now "out of scope".
+    if (LCtx->isParentOf(ELCtx))
+      return false;
+    return true;
+  }
+
   return LCtx->getAnalysis<RelaxedLiveVariables>()->isLive(Loc, ExprVal);
 }
 

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp Fri Jan 20 10:14:22 2012
@@ -236,13 +236,16 @@
 }
 
 void AnalysisConsumer::HandleTranslationUnit(ASTContext &C) {
-  BugReporter BR(*Mgr);
-  TranslationUnitDecl *TU = C.getTranslationUnitDecl();
-  checkerMgr->runCheckersOnASTDecl(TU, *Mgr, BR);
-  HandleDeclContext(C, TU);
+  {
+    // Introduce a scope to destroy BR before Mgr.
+    BugReporter BR(*Mgr);
+    TranslationUnitDecl *TU = C.getTranslationUnitDecl();
+    checkerMgr->runCheckersOnASTDecl(TU, *Mgr, BR);
+    HandleDeclContext(C, TU);
 
-  // After all decls handled, run checkers on the entire TranslationUnit.
-  checkerMgr->runCheckersOnEndOfTranslationUnit(TU, *Mgr, BR);
+    // After all decls handled, run checkers on the entire TranslationUnit.
+    checkerMgr->runCheckersOnEndOfTranslationUnit(TU, *Mgr, BR);
+  }
 
   // Explicitly destroy the PathDiagnosticConsumer.  This will flush its output.
   // FIXME: This should be replaced with something that doesn't rely on
@@ -337,8 +340,6 @@
                                    Decl *D) {
 
   switch (mgr.getLangOptions().getGC()) {
-  default:
-    llvm_unreachable("Invalid GC mode.");
   case LangOptions::NonGC:
     ActionExprEngine(C, mgr, D, false);
     break;

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Frontend/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Frontend/CMakeLists.txt?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Frontend/CMakeLists.txt (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Frontend/CMakeLists.txt Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 set(LLVM_NO_RTTI 1)
 
-set(LLVM_USED_LIBS clangBasic clangLex clangAST clangFrontend clangRewrite)
+set(LLVM_USED_LIBS clangBasic clangLex clangAST clangFrontend clangRewrite
+                   clangStaticAnalyzerCheckers)
 
 include_directories( ${CMAKE_CURRENT_BINARY_DIR}/../Checkers )
 

Modified: cfe/branches/tooling/lib/Tooling/Tooling.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Tooling/Tooling.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Tooling/Tooling.cpp (original)
+++ cfe/branches/tooling/lib/Tooling/Tooling.cpp Fri Jan 20 10:14:22 2012
@@ -223,10 +223,11 @@
 CompileCommand FindCompileArgsInJsonDatabase(
     llvm::StringRef FileName, llvm::StringRef JsonDatabase,
     std::string &ErrorMessage) {
-  llvm::JSONParser Parser(JsonDatabase);
+  llvm::SourceMgr SM;
+  llvm::JSONParser Parser(JsonDatabase, &SM);
   llvm::JSONValue *Root = Parser.parseRoot();
   if (Root == NULL) {
-    ErrorMessage = Parser.getErrorMessage();
+    ErrorMessage = "Error while parsing JSON.";
     return CompileCommand();
   }
   llvm::JSONArray *Array = llvm::dyn_cast<llvm::JSONArray>(Root);

Modified: cfe/branches/tooling/test/ARCMT/GC-check.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/GC-check.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/GC-check.m (original)
+++ cfe/branches/tooling/test/ARCMT/GC-check.m Fri Jan 20 10:14:22 2012
@@ -1,5 +1,6 @@
 // RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fobjc-gc-only %s
 // RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fobjc-gc-only -x objective-c++ %s
+// DISABLE: mingw32
 
 #define CF_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
 typedef unsigned NSUInteger;

Modified: cfe/branches/tooling/test/ARCMT/GC-no-arc-runtime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/GC-no-arc-runtime.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/GC-no-arc-runtime.m (original)
+++ cfe/branches/tooling/test/ARCMT/GC-no-arc-runtime.m Fri Jan 20 10:14:22 2012
@@ -3,6 +3,7 @@
 // RUN: diff %t %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-macosx10.6 -fsyntax-only -fobjc-gc-only -x objective-c++ %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 #include "GC.h"

Modified: cfe/branches/tooling/test/ARCMT/GC-no-arc-runtime.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/GC-no-arc-runtime.m.result?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/GC-no-arc-runtime.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/GC-no-arc-runtime.m.result Fri Jan 20 10:14:22 2012
@@ -3,6 +3,7 @@
 // RUN: diff %t %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-macosx10.6 -fsyntax-only -fobjc-gc-only -x objective-c++ %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 #include "GC.h"

Modified: cfe/branches/tooling/test/ARCMT/GC.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/GC.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/GC.m (original)
+++ cfe/branches/tooling/test/ARCMT/GC.m Fri Jan 20 10:14:22 2012
@@ -3,6 +3,7 @@
 // RUN: diff %t %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fsyntax-only -fobjc-gc-only -x objective-c++ %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 #include "GC.h"

Modified: cfe/branches/tooling/test/ARCMT/GC.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/GC.m.result?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/GC.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/GC.m.result Fri Jan 20 10:14:22 2012
@@ -3,6 +3,7 @@
 // RUN: diff %t %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fsyntax-only -fobjc-gc-only -x objective-c++ %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 #include "GC.h"

Modified: cfe/branches/tooling/test/ARCMT/api.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/api.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/api.m (original)
+++ cfe/branches/tooling/test/ARCMT/api.m Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 

Modified: cfe/branches/tooling/test/ARCMT/api.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/api.m.result?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/api.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/api.m.result Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 

Modified: cfe/branches/tooling/test/ARCMT/assign-prop-with-arc-runtime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/assign-prop-with-arc-runtime.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/assign-prop-with-arc-runtime.m (original)
+++ cfe/branches/tooling/test/ARCMT/assign-prop-with-arc-runtime.m Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fsyntax-only %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 

Modified: cfe/branches/tooling/test/ARCMT/assign-prop-with-arc-runtime.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/assign-prop-with-arc-runtime.m.result?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/assign-prop-with-arc-runtime.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/assign-prop-with-arc-runtime.m.result Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-macosx10.7 -fsyntax-only %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 

Modified: cfe/branches/tooling/test/ARCMT/atautorelease-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/atautorelease-2.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/atautorelease-2.m (original)
+++ cfe/branches/tooling/test/ARCMT/atautorelease-2.m Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 @interface NSAutoreleasePool
 - drain;

Modified: cfe/branches/tooling/test/ARCMT/atautorelease-2.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/atautorelease-2.m.result?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/atautorelease-2.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/atautorelease-2.m.result Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 @interface NSAutoreleasePool
 - drain;

Modified: cfe/branches/tooling/test/ARCMT/atautorelease-3.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/atautorelease-3.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/atautorelease-3.m (original)
+++ cfe/branches/tooling/test/ARCMT/atautorelease-3.m Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 @interface NSAutoreleasePool
 - drain;

Modified: cfe/branches/tooling/test/ARCMT/atautorelease-3.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/atautorelease-3.m.result?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/atautorelease-3.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/atautorelease-3.m.result Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 @interface NSAutoreleasePool
 - drain;

Modified: cfe/branches/tooling/test/ARCMT/atautorelease-check.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/atautorelease-check.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/atautorelease-check.m (original)
+++ cfe/branches/tooling/test/ARCMT/atautorelease-check.m Fri Jan 20 10:14:22 2012
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 %s
+// DISABLE: mingw32
 
 #if __has_feature(objc_arr)
 #define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))

Modified: cfe/branches/tooling/test/ARCMT/atautorelease.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/atautorelease.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/atautorelease.m (original)
+++ cfe/branches/tooling/test/ARCMT/atautorelease.m Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 

Modified: cfe/branches/tooling/test/ARCMT/atautorelease.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/atautorelease.m.result?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/atautorelease.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/atautorelease.m.result Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 

Modified: cfe/branches/tooling/test/ARCMT/autoreleases.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/autoreleases.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/autoreleases.m (original)
+++ cfe/branches/tooling/test/ARCMT/autoreleases.m Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 typedef unsigned char BOOL;
 

Modified: cfe/branches/tooling/test/ARCMT/autoreleases.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/autoreleases.m.result?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/autoreleases.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/autoreleases.m.result Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 typedef unsigned char BOOL;
 

Modified: cfe/branches/tooling/test/ARCMT/checking.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/checking.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/checking.m (original)
+++ cfe/branches/tooling/test/ARCMT/checking.m Fri Jan 20 10:14:22 2012
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 %s
+// DISABLE: mingw32
 
 #if __has_feature(objc_arc)
 #define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))

Modified: cfe/branches/tooling/test/ARCMT/cxx-checking.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/cxx-checking.mm?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/cxx-checking.mm (original)
+++ cfe/branches/tooling/test/ARCMT/cxx-checking.mm Fri Jan 20 10:14:22 2012
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fsyntax-only -fblocks -Warc-abi  %s
+// DISABLE: mingw32
 
 // Classes that have an Objective-C object pointer.
 struct HasObjectMember0 { // expected-warning{{'HasObjectMember0' cannot be shared between ARC and non-ARC code; add a copy constructor, a copy assignment operator, and a destructor to make it ABI-compatible}}

Modified: cfe/branches/tooling/test/ARCMT/cxx-rewrite.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/cxx-rewrite.mm?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/cxx-rewrite.mm (original)
+++ cfe/branches/tooling/test/ARCMT/cxx-rewrite.mm Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c++ %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c++ %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 

Modified: cfe/branches/tooling/test/ARCMT/cxx-rewrite.mm.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/cxx-rewrite.mm.result?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/cxx-rewrite.mm.result (original)
+++ cfe/branches/tooling/test/ARCMT/cxx-rewrite.mm.result Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c++ %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c++ %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 

Modified: cfe/branches/tooling/test/ARCMT/dealloc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/dealloc.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/dealloc.m (original)
+++ cfe/branches/tooling/test/ARCMT/dealloc.m Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 @interface A
 - (id)retain;

Modified: cfe/branches/tooling/test/ARCMT/dealloc.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/dealloc.m.result?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/dealloc.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/dealloc.m.result Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 @interface A
 - (id)retain;

Modified: cfe/branches/tooling/test/ARCMT/init.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/init.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/init.m (original)
+++ cfe/branches/tooling/test/ARCMT/init.m Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 @interface NSObject
 -init;

Modified: cfe/branches/tooling/test/ARCMT/init.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/init.m.result?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/init.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/init.m.result Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 @interface NSObject
 -init;

Modified: cfe/branches/tooling/test/ARCMT/migrate-plist-output.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/migrate-plist-output.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/migrate-plist-output.m (original)
+++ cfe/branches/tooling/test/ARCMT/migrate-plist-output.m Fri Jan 20 10:14:22 2012
@@ -48,3 +48,5 @@
 // CHECK:  </array>
 // CHECK: </dict>
 // CHECK: </plist>
+
+// DISABLE: mingw32

Modified: cfe/branches/tooling/test/ARCMT/migrate-space-in-path.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/migrate-space-in-path.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/migrate-space-in-path.m (original)
+++ cfe/branches/tooling/test/ARCMT/migrate-space-in-path.m Fri Jan 20 10:14:22 2012
@@ -3,3 +3,4 @@
 // RUN: %clang_cc1 -arcmt-migrate -arcmt-migrate-directory %t.migrate %S/"with space"/test2.m.in -x objective-c 
 // RUN: c-arcmt-test -arcmt-migrate-directory %t.migrate | arcmt-test -verify-transformed-files %S/"with space"/test1.m.in.result %S/"with space"/test2.m.in.result %S/"with space"/test.h.result
 // RUN: rm -rf %t.migrate
+// DISABLE: mingw32

Modified: cfe/branches/tooling/test/ARCMT/migrate.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/migrate.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/migrate.m (original)
+++ cfe/branches/tooling/test/ARCMT/migrate.m Fri Jan 20 10:14:22 2012
@@ -3,3 +3,4 @@
 // RUN: %clang_cc1 -arcmt-migrate -arcmt-migrate-directory %t %S/Inputs/test2.m.in -x objective-c 
 // RUN: c-arcmt-test -arcmt-migrate-directory %t | arcmt-test -verify-transformed-files %S/Inputs/test1.m.in.result %S/Inputs/test2.m.in.result %S/Inputs/test.h.result
 // RUN: rm -rf %t
+// DISABLE: mingw32

Modified: cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast-2.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast-2.m (original)
+++ cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast-2.m Fri Jan 20 10:14:22 2012
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 %s
+// DISABLE: mingw32
 
 #include "Common.h"
 

Modified: cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast.m (original)
+++ cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast.m Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 

Modified: cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast.m.result?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/nonobjc-to-objc-cast.m.result Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
 // RUN: diff %t %s.result
+// DISABLE: mingw32
 
 #include "Common.h"
 

Modified: cfe/branches/tooling/test/Analysis/auto-obj-dtors-cfg-output.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/auto-obj-dtors-cfg-output.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/auto-obj-dtors-cfg-output.cpp (original)
+++ cfe/branches/tooling/test/Analysis/auto-obj-dtors-cfg-output.cpp Fri Jan 20 10:14:22 2012
@@ -155,726 +155,690 @@
   }
 }
 
-// CHECK:  [ B2 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B1 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:       3: a
-// CHECK:       4: [B1.3]
-// CHECK:       5: const A &b = a;
-// CHECK:       6: A()
-// CHECK:       7: [B1.6] (BindTemporary)
-// CHECK:       8: [B1.7]
-// CHECK:       9: [B1.8]
-// CHECK:      10: const A &c = A();
-// CHECK:      11: [B1.10].~A() (Implicit destructor)
-// CHECK:      12: [B1.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B2 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B1 ]
-// CHECK:       1: 
-// CHECK:       2: A a[2];
-// CHECK:       3: 
-// CHECK:       4: A b[0];
-// CHECK:       5: [B1.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B2 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B1 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:       3: 
-// CHECK:       4: A c;
-// CHECK:       5: 
-// CHECK:       6: A d;
-// CHECK:       7: [B1.6].~A() (Implicit destructor)
-// CHECK:       8: [B1.4].~A() (Implicit destructor)
-// CHECK:       9: 
-// CHECK:      10: A b;
-// CHECK:      11: [B1.10].~A() (Implicit destructor)
-// CHECK:      12: [B1.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B4 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B3
-// CHECK:  [ B1 ]
-// CHECK:       1: 
-// CHECK:       2: A c;
-// CHECK:       3: [B1.2].~A() (Implicit destructor)
-// CHECK:       4: [B3.4].~A() (Implicit destructor)
-// CHECK:       5: [B3.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B3
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: return;
-// CHECK:       2: [B3.4].~A() (Implicit destructor)
-// CHECK:       3: [B3.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B3
-// CHECK:     Successors (1): B0
-// CHECK:  [ B3 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:       3: 
-// CHECK:       4: A b;
-// CHECK:       5: UV
-// CHECK:       6: [B3.5]
-// CHECK:       T: if [B3.6]
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (2): B2 B1
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (2): B1 B2
-// CHECK:     Successors (0):
-// CHECK:  [ B8 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B7
-// CHECK:  [ B1 ]
-// CHECK:     l1:
-// CHECK:       1: 
-// CHECK:       2: A c;
-// CHECK:       3: [B1.2].~A() (Implicit destructor)
-// CHECK:       4: [B6.2].~A() (Implicit destructor)
-// CHECK:       5: [B7.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (2): B2 B3
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: 
-// CHECK:       2: A b;
-// CHECK:       3: [B2.2].~A() (Implicit destructor)
-// CHECK:       4: [B6.4].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B3 ]
-// CHECK:       1: [B6.4].~A() (Implicit destructor)
-// CHECK:       T: goto l1;
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B4 ]
-// CHECK:       1: UV
-// CHECK:       2: [B4.1]
-// CHECK:       T: if [B4.2]
-// CHECK:     Predecessors (1): B6
-// CHECK:     Successors (2): B3 B2
-// CHECK:  [ B5 ]
-// CHECK:       1: [B6.4].~A() (Implicit destructor)
-// CHECK:       2: [B6.2].~A() (Implicit destructor)
-// CHECK:       T: goto l0;
-// CHECK:     Predecessors (1): B6
-// CHECK:     Successors (1): B6
-// CHECK:  [ B6 ]
-// CHECK:     l0:
-// CHECK:       1: 
-// CHECK:       2: A b;
-// CHECK:       3: 
-// CHECK:       4: A a;
-// CHECK:       5: UV
-// CHECK:       6: [B6.5]
-// CHECK:       T: if [B6.6]
-// CHECK:     Predecessors (2): B7 B5
-// CHECK:     Successors (2): B5 B4
-// CHECK:  [ B7 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:     Predecessors (1): B8
-// CHECK:     Successors (1): B6
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B5 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B4
-// CHECK:  [ B1 ]
-// CHECK:       1: [B4.6].~A() (Implicit destructor)
-// CHECK:       2: [B4.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (2): B2 B3
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: 
-// CHECK:       2: A c;
-// CHECK:       3: [B2.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B3 ]
-// CHECK:       1: 
-// CHECK:       2: A c;
-// CHECK:       3: [B3.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B4 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:       3: a
-// CHECK:       4: [B4.3]
-// CHECK:       5: [B4.4]
-// CHECK:       6: A b = a;
-// CHECK:       7: b
-// CHECK:       8: [B4.7]
-// CHECK:       9: [B4.8].operator int
-// CHECK:      10: [B4.9]()
-// CHECK:      11: [B4.10]
-// CHECK:      12: [B4.11]
-// CHECK:       T: if [B4.12]
-// CHECK:     Predecessors (1): B5
-// CHECK:     Successors (2): B3 B2
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B9 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B8
-// CHECK:  [ B1 ]
-// CHECK:       1: [B8.6].~A() (Implicit destructor)
-// CHECK:       2: 
-// CHECK:       3: A e;
-// CHECK:       4: [B1.3].~A() (Implicit destructor)
-// CHECK:       5: [B8.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (2): B2 B5
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: 
-// CHECK:       2: A d;
-// CHECK:       3: [B2.2].~A() (Implicit destructor)
-// CHECK:       4: [B4.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B3 ]
-// CHECK:       1: return;
-// CHECK:       2: [B4.2].~A() (Implicit destructor)
-// CHECK:       3: [B8.6].~A() (Implicit destructor)
-// CHECK:       4: [B8.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B0
-// CHECK:  [ B4 ]
-// CHECK:       1: 
-// CHECK:       2: A c;
-// CHECK:       3: UV
-// CHECK:       4: [B4.3]
-// CHECK:       T: if [B4.4]
-// CHECK:     Predecessors (1): B8
-// CHECK:     Successors (2): B3 B2
-// CHECK:  [ B5 ]
-// CHECK:       1: 
-// CHECK:       2: A d;
-// CHECK:       3: [B5.2].~A() (Implicit destructor)
-// CHECK:       4: [B7.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (1): B1
-// CHECK:  [ B6 ]
-// CHECK:       1: return;
-// CHECK:       2: [B7.2].~A() (Implicit destructor)
-// CHECK:       3: [B8.6].~A() (Implicit destructor)
-// CHECK:       4: [B8.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (1): B0
-// CHECK:  [ B7 ]
-// CHECK:       1: 
-// CHECK:       2: A c;
-// CHECK:       3: UV
-// CHECK:       4: [B7.3]
-// CHECK:       T: if [B7.4]
-// CHECK:     Predecessors (1): B8
-// CHECK:     Successors (2): B6 B5
-// CHECK:  [ B8 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:       3: a
-// CHECK:       4: [B8.3]
-// CHECK:       5: [B8.4]
-// CHECK:       6: A b = a;
-// CHECK:       7: b
-// CHECK:       8: [B8.7]
-// CHECK:       9: [B8.8].operator int
-// CHECK:      10: [B8.9]()
-// CHECK:      11: [B8.10]
-// CHECK:      12: [B8.11]
-// CHECK:       T: if [B8.12]
-// CHECK:     Predecessors (1): B9
-// CHECK:     Successors (2): B7 B4
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (3): B1 B3 B6
-// CHECK:     Successors (0):
-// CHECK:  [ B6 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B5
-// CHECK:  [ B1 ]
-// CHECK:       1: [B2.4].~A() (Implicit destructor)
-// CHECK:       2: [B5.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: a
-// CHECK:       2: [B2.1]
-// CHECK:       3: [B2.2]
-// CHECK:       4: A b = a;
-// CHECK:       5: b
-// CHECK:       6: [B2.5]
-// CHECK:       7: [B2.6].operator int
-// CHECK:       8: [B2.7]()
-// CHECK:       9: [B2.8]
-// CHECK:      10: [B2.9]
-// CHECK:       T: while [B2.10]
-// CHECK:     Predecessors (2): B3 B5
-// CHECK:     Successors (2): B4 B1
-// CHECK:  [ B3 ]
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B2
-// CHECK:  [ B4 ]
-// CHECK:       1: 
-// CHECK:       2: A c;
-// CHECK:       3: [B4.2].~A() (Implicit destructor)
-// CHECK:       4: [B2.4].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B3
-// CHECK:  [ B5 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:     Predecessors (1): B6
-// CHECK:     Successors (1): B2
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B12 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B11
-// CHECK:  [ B1 ]
-// CHECK:       1: [B2.4].~A() (Implicit destructor)
-// CHECK:       2: 
-// CHECK:       3: A e;
-// CHECK:       4: [B1.3].~A() (Implicit destructor)
-// CHECK:       5: [B11.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (2): B9 B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: a
-// CHECK:       2: [B2.1]
-// CHECK:       3: [B2.2]
-// CHECK:       4: A b = a;
-// CHECK:       5: b
-// CHECK:       6: [B2.5]
-// CHECK:       7: [B2.6].operator int
-// CHECK:       8: [B2.7]()
-// CHECK:       9: [B2.8]
-// CHECK:      10: [B2.9]
-// CHECK:       T: while [B2.10]
-// CHECK:     Predecessors (2): B3 B11
-// CHECK:     Successors (2): B10 B1
-// CHECK:  [ B3 ]
-// CHECK:     Predecessors (2): B4 B7
-// CHECK:     Successors (1): B2
-// CHECK:  [ B4 ]
-// CHECK:       1: 
-// CHECK:       2: A d;
-// CHECK:       3: [B4.2].~A() (Implicit destructor)
-// CHECK:       4: [B10.2].~A() (Implicit destructor)
-// CHECK:       5: [B2.4].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B6
-// CHECK:     Successors (1): B3
-// CHECK:  [ B5 ]
-// CHECK:       1: return;
-// CHECK:       2: [B10.2].~A() (Implicit destructor)
-// CHECK:       3: [B2.4].~A() (Implicit destructor)
-// CHECK:       4: [B11.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B6
-// CHECK:     Successors (1): B0
-// CHECK:  [ B6 ]
-// CHECK:       1: UV
-// CHECK:       2: [B6.1]
-// CHECK:       T: if [B6.2]
-// CHECK:     Predecessors (1): B8
-// CHECK:     Successors (2): B5 B4
-// CHECK:  [ B7 ]
-// CHECK:       1: [B10.2].~A() (Implicit destructor)
-// CHECK:       2: [B2.4].~A() (Implicit destructor)
-// CHECK:       T: continue;
-// CHECK:     Predecessors (1): B8
-// CHECK:     Successors (1): B3
-// CHECK:  [ B8 ]
-// CHECK:       1: UV
-// CHECK:       2: [B8.1]
-// CHECK:       T: if [B8.2]
-// CHECK:     Predecessors (1): B10
-// CHECK:     Successors (2): B7 B6
-// CHECK:  [ B9 ]
-// CHECK:       1: [B10.2].~A() (Implicit destructor)
-// CHECK:       T: break;
-// CHECK:     Predecessors (1): B10
-// CHECK:     Successors (1): B1
-// CHECK:  [ B10 ]
-// CHECK:       1: 
-// CHECK:       2: A c;
-// CHECK:       3: UV
-// CHECK:       4: [B10.3]
-// CHECK:       T: if [B10.4]
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (2): B9 B8
-// CHECK:  [ B11 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:     Predecessors (1): B12
-// CHECK:     Successors (1): B2
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (2): B1 B5
-// CHECK:     Successors (0):
-// CHECK:  [ B4 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B2
-// CHECK:  [ B1 ]
-// CHECK:       1: UV
-// CHECK:       2: [B1.1]
-// CHECK:       T: do ... while [B1.2]
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (2): B3 B0
-// CHECK:  [ B2 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:       3: [B2.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (2): B3 B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B3 ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (1): B2
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B12 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B11
-// CHECK:  [ B1 ]
-// CHECK:       1: 
-// CHECK:       2: A d;
-// CHECK:       3: [B1.2].~A() (Implicit destructor)
-// CHECK:       4: [B11.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (2): B8 B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: UV
-// CHECK:       2: [B2.1]
-// CHECK:       T: do ... while [B2.2]
-// CHECK:     Predecessors (2): B3 B6
-// CHECK:     Successors (2): B10 B1
-// CHECK:  [ B3 ]
-// CHECK:       1: 
-// CHECK:       2: A c;
-// CHECK:       3: [B3.2].~A() (Implicit destructor)
-// CHECK:       4: [B9.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B5
-// CHECK:     Successors (1): B2
-// CHECK:  [ B4 ]
-// CHECK:       1: return;
-// CHECK:       2: [B9.2].~A() (Implicit destructor)
-// CHECK:       3: [B11.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B5
-// CHECK:     Successors (1): B0
-// CHECK:  [ B5 ]
-// CHECK:       1: UV
-// CHECK:       2: [B5.1]
-// CHECK:       T: if [B5.2]
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (2): B4 B3
-// CHECK:  [ B6 ]
-// CHECK:       1: [B9.2].~A() (Implicit destructor)
-// CHECK:       T: continue;
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (1): B2
-// CHECK:  [ B7 ]
-// CHECK:       1: UV
-// CHECK:       2: [B7.1]
-// CHECK:       T: if [B7.2]
-// CHECK:     Predecessors (1): B9
-// CHECK:     Successors (2): B6 B5
-// CHECK:  [ B8 ]
-// CHECK:       1: [B9.2].~A() (Implicit destructor)
-// CHECK:       T: break;
-// CHECK:     Predecessors (1): B9
-// CHECK:     Successors (1): B1
-// CHECK:  [ B9 ]
-// CHECK:       1: 
-// CHECK:       2: A b;
-// CHECK:       3: UV
-// CHECK:       4: [B9.3]
-// CHECK:       T: if [B9.4]
-// CHECK:     Predecessors (2): B10 B11
-// CHECK:     Successors (2): B8 B7
-// CHECK:  [ B10 ]
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B9
-// CHECK:  [ B11 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:     Predecessors (1): B12
-// CHECK:     Successors (1): B9
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (2): B1 B4
-// CHECK:     Successors (0):
-// CHECK:  [ B4 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B2
-// CHECK:  [ B1 ]
-// CHECK:       1: [B2.6].~A() (Implicit destructor)
-// CHECK:       2: [B2.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (2): B3 B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:       3: a
-// CHECK:       4: [B2.3]
-// CHECK:       5: [B2.4]
-// CHECK:       6: A b = a;
-// CHECK:       7: b
-// CHECK:       8: [B2.7]
-// CHECK:       9: [B2.8].operator int
-// CHECK:      10: [B2.9]()
-// CHECK:      11: [B2.10]
-// CHECK:       T: switch [B2.11]
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B3 ]
-// CHECK:       1: 
-// CHECK:       2: A c;
-// CHECK:       3: [B3.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B9 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B2
-// CHECK:  [ B1 ]
-// CHECK:       1: [B2.6].~A() (Implicit destructor)
-// CHECK:       2: 
-// CHECK:       3: A g;
-// CHECK:       4: [B1.3].~A() (Implicit destructor)
-// CHECK:       5: [B2.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (3): B3 B7 B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:       3: a
-// CHECK:       4: [B2.3]
-// CHECK:       5: [B2.4]
-// CHECK:       6: A b = a;
-// CHECK:       7: b
-// CHECK:       8: [B2.7]
-// CHECK:       9: [B2.8].operator int
-// CHECK:      10: [B2.9]()
-// CHECK:      11: [B2.10]
-// CHECK:       T: switch [B2.11]
-// CHECK:     Predecessors (1): B9
-// CHECK:     Successors (3): B3 B8
+// CHECK:  [B2 (ENTRY)]
+// CHECK:    Succs (1): B1
+// CHECK:  [B1]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    3: a
+// CHECK:    4: [B1.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    5: const A &b = a;
+// CHECK:    6: A() (CXXConstructExpr, class A)
+// CHECK:    7: [B1.6] (BindTemporary)
+// CHECK:    8: [B1.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    9: [B1.8]
+// CHECK:   10: const A &c = A();
+// CHECK:   11: [B1.10].~A() (Implicit destructor)
+// CHECK:   12: [B1.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (1): B0
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (1): B1
+// CHECK:  [B2 (ENTRY)]
+// CHECK:    Succs (1): B1
+// CHECK:  [B1]
+// CHECK:    1:  (CXXConstructExpr, class A [2])
+// CHECK:    2: A a[2];
+// CHECK:    3:  (CXXConstructExpr, class A [0])
+// CHECK:    4: A b[0];
+// CHECK:    5: [B1.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (1): B0
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (1): B1
+// CHECK:  [B2 (ENTRY)]
+// CHECK:    Succs (1): B1
+// CHECK:  [B1]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    3:  (CXXConstructExpr, class A)
+// CHECK:    4: A c;
+// CHECK:    5:  (CXXConstructExpr, class A)
+// CHECK:    6: A d;
+// CHECK:    7: [B1.6].~A() (Implicit destructor)
+// CHECK:    8: [B1.4].~A() (Implicit destructor)
+// CHECK:    9:  (CXXConstructExpr, class A)
+// CHECK:   10: A b;
+// CHECK:   11: [B1.10].~A() (Implicit destructor)
+// CHECK:   12: [B1.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (1): B0
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (1): B1
+// CHECK:  [B4 (ENTRY)]
+// CHECK:    Succs (1): B3
+// CHECK:  [B1]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A c;
+// CHECK:    3: [B1.2].~A() (Implicit destructor)
+// CHECK:    4: [B3.4].~A() (Implicit destructor)
+// CHECK:    5: [B3.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B3
+// CHECK:    Succs (1): B0
+// CHECK:  [B2]
+// CHECK:    1: return;
+// CHECK:    2: [B3.4].~A() (Implicit destructor)
+// CHECK:    3: [B3.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B3
+// CHECK:    Succs (1): B0
+// CHECK:  [B3]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    3:  (CXXConstructExpr, class A)
+// CHECK:    4: A b;
+// CHECK:    5: UV
+// CHECK:    6: [B3.5] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B3.6]
+// CHECK:    Preds (1): B4
+// CHECK:    Succs (2): B2 B1
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (2): B1 B2
+// CHECK:  [B8 (ENTRY)]
+// CHECK:    Succs (1): B7
+// CHECK:  [B1]
+// CHECK:   l1:
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A c;
+// CHECK:    3: [B1.2].~A() (Implicit destructor)
+// CHECK:    4: [B6.2].~A() (Implicit destructor)
+// CHECK:    5: [B7.2].~A() (Implicit destructor)
+// CHECK:    Preds (2): B2 B3
+// CHECK:    Succs (1): B0
+// CHECK:  [B2]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A b;
+// CHECK:    3: [B2.2].~A() (Implicit destructor)
+// CHECK:    4: [B6.4].~A() (Implicit destructor)
+// CHECK:    Preds (1): B4
+// CHECK:    Succs (1): B1
+// CHECK:  [B3]
+// CHECK:    1: [B6.4].~A() (Implicit destructor)
+// CHECK:    T: goto l1;
+// CHECK:    Preds (1): B4
+// CHECK:    Succs (1): B1
+// CHECK:  [B4]
+// CHECK:    1: UV
+// CHECK:    2: [B4.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B4.2]
+// CHECK:    Preds (1): B6
+// CHECK:    Succs (2): B3 B2
+// CHECK:  [B5]
+// CHECK:    1: [B6.4].~A() (Implicit destructor)
+// CHECK:    2: [B6.2].~A() (Implicit destructor)
+// CHECK:    T: goto l0;
+// CHECK:    Preds (1): B6
+// CHECK:    Succs (1): B6
+// CHECK:  [B6]
+// CHECK:   l0:
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A b;
+// CHECK:    3:  (CXXConstructExpr, class A)
+// CHECK:    4: A a;
+// CHECK:    5: UV
+// CHECK:    6: [B6.5] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B6.6]
+// CHECK:    Preds (2): B7 B5
+// CHECK:    Succs (2): B5 B4
+// CHECK:  [B7]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    Preds (1): B8
+// CHECK:    Succs (1): B6
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (1): B1
+// CHECK:  [B5 (ENTRY)]
+// CHECK:    Succs (1): B4
+// CHECK:  [B1]
+// CHECK:    1: [B4.6].~A() (Implicit destructor)
+// CHECK:    2: [B4.2].~A() (Implicit destructor)
+// CHECK:    Preds (2): B2 B3
+// CHECK:    Succs (1): B0
+// CHECK:  [B2]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A c;
+// CHECK:    3: [B2.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B4
+// CHECK:    Succs (1): B1
+// CHECK:  [B3]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A c;
+// CHECK:    3: [B3.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B4
+// CHECK:    Succs (1): B1
+// CHECK:  [B4]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    3: a
+// CHECK:    4: [B4.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    5: [B4.4] (CXXConstructExpr, class A)
+// CHECK:    6: A b = a;
+// CHECK:    7: b
+// CHECK:    8: [B4.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    9: [B4.8].operator int
+// CHECK:   10: [B4.9]()
+// CHECK:   11: [B4.10] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:   12: [B4.11] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK:    T: if [B4.12]
+// CHECK:    Preds (1): B5
+// CHECK:    Succs (2): B3 B2
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (1): B1
+// CHECK:  [B9 (ENTRY)]
+// CHECK:    Succs (1): B8
+// CHECK:  [B1]
+// CHECK:    1: [B8.6].~A() (Implicit destructor)
+// CHECK:    2:  (CXXConstructExpr, class A)
+// CHECK:    3: A e;
+// CHECK:    4: [B1.3].~A() (Implicit destructor)
+// CHECK:    5: [B8.2].~A() (Implicit destructor)
+// CHECK:    Preds (2): B2 B5
+// CHECK:    Succs (1): B0
+// CHECK:  [B2]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A d;
+// CHECK:    3: [B2.2].~A() (Implicit destructor)
+// CHECK:    4: [B4.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B4
+// CHECK:    Succs (1): B1
+// CHECK:  [B3]
+// CHECK:    1: return;
+// CHECK:    2: [B4.2].~A() (Implicit destructor)
+// CHECK:    3: [B8.6].~A() (Implicit destructor)
+// CHECK:    4: [B8.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B4
+// CHECK:    Succs (1): B0
+// CHECK:  [B4]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A c;
+// CHECK:    3: UV
+// CHECK:    4: [B4.3] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B4.4]
+// CHECK:    Preds (1): B8
+// CHECK:    Succs (2): B3 B2
+// CHECK:  [B5]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A d;
+// CHECK:    3: [B5.2].~A() (Implicit destructor)
+// CHECK:    4: [B7.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B7
+// CHECK:    Succs (1): B1
+// CHECK:  [B6]
+// CHECK:    1: return;
+// CHECK:    2: [B7.2].~A() (Implicit destructor)
+// CHECK:    3: [B8.6].~A() (Implicit destructor)
+// CHECK:    4: [B8.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B7
+// CHECK:    Succs (1): B0
+// CHECK:  [B7]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A c;
+// CHECK:    3: UV
+// CHECK:    4: [B7.3] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B7.4]
+// CHECK:    Preds (1): B8
+// CHECK:    Succs (2): B6 B5
+// CHECK:  [B8]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    3: a
+// CHECK:    4: [B8.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    5: [B8.4] (CXXConstructExpr, class A)
+// CHECK:    6: A b = a;
+// CHECK:    7: b
+// CHECK:    8: [B8.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    9: [B8.8].operator int
+// CHECK:   10: [B8.9]()
+// CHECK:   11: [B8.10] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:   12: [B8.11] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK:    T: if [B8.12]
+// CHECK:    Preds (1): B9
+// CHECK:    Succs (2): B7 B4
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (3): B1 B3 B6
+// CHECK:  [B6 (ENTRY)]
+// CHECK:    Succs (1): B5
+// CHECK:  [B1]
+// CHECK:    1: [B2.4].~A() (Implicit destructor)
+// CHECK:    2: [B5.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (1): B0
+// CHECK:  [B2]
+// CHECK:    1: a
+// CHECK:    2: [B2.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    3: [B2.2] (CXXConstructExpr, class A)
+// CHECK:    4: A b = a;
+// CHECK:    5: b
+// CHECK:    6: [B2.5] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    7: [B2.6].operator int
+// CHECK:    8: [B2.7]()
+// CHECK:    9: [B2.8] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:   10: [B2.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK:    T: while [B2.10]
+// CHECK:    Preds (2): B3 B5
+// CHECK:    Succs (2): B4 B1
+// CHECK:  [B3]
+// CHECK:    Preds (1): B4
+// CHECK:    Succs (1): B2
+// CHECK:  [B4]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A c;
+// CHECK:    3: [B4.2].~A() (Implicit destructor)
+// CHECK:    4: [B2.4].~A() (Implicit destructor)
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (1): B3
+// CHECK:  [B5]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    Preds (1): B6
+// CHECK:    Succs (1): B2
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (1): B1
+// CHECK:  [B12 (ENTRY)]
+// CHECK:    Succs (1): B11
+// CHECK:  [B1]
+// CHECK:    1: [B2.4].~A() (Implicit destructor)
+// CHECK:    2:  (CXXConstructExpr, class A)
+// CHECK:    3: A e;
+// CHECK:    4: [B1.3].~A() (Implicit destructor)
+// CHECK:    5: [B11.2].~A() (Implicit destructor)
+// CHECK:    Preds (2): B9 B2
+// CHECK:    Succs (1): B0
+// CHECK:  [B2]
+// CHECK:    1: a
+// CHECK:    2: [B2.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    3: [B2.2] (CXXConstructExpr, class A)
+// CHECK:    4: A b = a;
+// CHECK:    5: b
+// CHECK:    6: [B2.5] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    7: [B2.6].operator int
+// CHECK:    8: [B2.7]()
+// CHECK:    9: [B2.8] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:   10: [B2.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK:    T: while [B2.10]
+// CHECK:    Preds (2): B3 B11
+// CHECK:    Succs (2): B10 B1
+// CHECK:  [B3]
+// CHECK:    Preds (2): B4 B7
+// CHECK:    Succs (1): B2
+// CHECK:  [B4]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A d;
+// CHECK:    3: [B4.2].~A() (Implicit destructor)
+// CHECK:    4: [B10.2].~A() (Implicit destructor)
+// CHECK:    5: [B2.4].~A() (Implicit destructor)
+// CHECK:    Preds (1): B6
+// CHECK:    Succs (1): B3
+// CHECK:  [B5]
+// CHECK:    1: return;
+// CHECK:    2: [B10.2].~A() (Implicit destructor)
+// CHECK:    3: [B2.4].~A() (Implicit destructor)
+// CHECK:    4: [B11.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B6
+// CHECK:    Succs (1): B0
+// CHECK:  [B6]
+// CHECK:    1: UV
+// CHECK:    2: [B6.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B6.2]
+// CHECK:    Preds (1): B8
+// CHECK:    Succs (2): B5 B4
+// CHECK:  [B7]
+// CHECK:    1: [B10.2].~A() (Implicit destructor)
+// CHECK:    2: [B2.4].~A() (Implicit destructor)
+// CHECK:    T: continue;
+// CHECK:    Preds (1): B8
+// CHECK:    Succs (1): B3
+// CHECK:  [B8]
+// CHECK:    1: UV
+// CHECK:    2: [B8.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B8.2]
+// CHECK:    Preds (1): B10
+// CHECK:    Succs (2): B7 B6
+// CHECK:  [B9]
+// CHECK:    1: [B10.2].~A() (Implicit destructor)
+// CHECK:    T: break;
+// CHECK:    Preds (1): B10
+// CHECK:    Succs (1): B1
+// CHECK:  [B10]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A c;
+// CHECK:    3: UV
+// CHECK:    4: [B10.3] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B10.4]
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (2): B9 B8
+// CHECK:  [B11]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    Preds (1): B12
+// CHECK:    Succs (1): B2
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (2): B1 B5
+// CHECK:  [B4 (ENTRY)]
+// CHECK:    Succs (1): B2
+// CHECK:  [B1]
+// CHECK:    1: UV
+// CHECK:    2: [B1.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: do ... while [B1.2]
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (2): B3 B0
+// CHECK:  [B2]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    3: [B2.2].~A() (Implicit destructor)
+// CHECK:    Preds (2): B3 B4
+// CHECK:    Succs (1): B1
+// CHECK:  [B3]
+// CHECK:    Preds (1): B1
+// CHECK:    Succs (1): B2
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (1): B1
+// CHECK:  [B12 (ENTRY)]
+// CHECK:    Succs (1): B11
+// CHECK:  [B1]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A d;
+// CHECK:    3: [B1.2].~A() (Implicit destructor)
+// CHECK:    4: [B11.2].~A() (Implicit destructor)
+// CHECK:    Preds (2): B8 B2
+// CHECK:    Succs (1): B0
+// CHECK:  [B2]
+// CHECK:    1: UV
+// CHECK:    2: [B2.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: do ... while [B2.2]
+// CHECK:    Preds (2): B3 B6
+// CHECK:    Succs (2): B10 B1
+// CHECK:  [B3]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A c;
+// CHECK:    3: [B3.2].~A() (Implicit destructor)
+// CHECK:    4: [B9.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B5
+// CHECK:    Succs (1): B2
+// CHECK:  [B4]
+// CHECK:    1: return;
+// CHECK:    2: [B9.2].~A() (Implicit destructor)
+// CHECK:    3: [B11.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B5
+// CHECK:    Succs (1): B0
+// CHECK:  [B5]
+// CHECK:    1: UV
+// CHECK:    2: [B5.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B5.2]
+// CHECK:    Preds (1): B7
+// CHECK:    Succs (2): B4 B3
+// CHECK:  [B6]
+// CHECK:    1: [B9.2].~A() (Implicit destructor)
+// CHECK:    T: continue;
+// CHECK:    Preds (1): B7
+// CHECK:    Succs (1): B2
+// CHECK:  [B7]
+// CHECK:    1: UV
+// CHECK:    2: [B7.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B7.2]
+// CHECK:    Preds (1): B9
+// CHECK:    Succs (2): B6 B5
+// CHECK:  [B8]
+// CHECK:    1: [B9.2].~A() (Implicit destructor)
+// CHECK:    T: break;
+// CHECK:    Preds (1): B9
+// CHECK:    Succs (1): B1
+// CHECK:  [B9]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A b;
+// CHECK:    3: UV
+// CHECK:    4: [B9.3] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B9.4]
+// CHECK:    Preds (2): B10 B11
+// CHECK:    Succs (2): B8 B7
+// CHECK:  [B10]
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (1): B9
+// CHECK:  [B11]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    Preds (1): B12
+// CHECK:    Succs (1): B9
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (2): B1 B4
+// CHECK:  [B4 (ENTRY)]
+// CHECK:    Succs (1): B2
+// CHECK:  [B1]
+// CHECK:    1: [B2.6].~A() (Implicit destructor)
+// CHECK:    2: [B2.2].~A() (Implicit destructor)
+// CHECK:    Preds (2): B3 B2
+// CHECK:    Succs (1): B0
+// CHECK:  [B2]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    3: a
+// CHECK:    4: [B2.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    5: [B2.4] (CXXConstructExpr, class A)
+// CHECK:    6: A b = a;
+// CHECK:    7: b
+// CHECK:    8: [B2.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    9: [B2.8].operator int
+// CHECK:   10: [B2.9]()
+// CHECK:   11: [B2.10] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:    T: switch [B2.11]
+// CHECK:    Preds (1): B4
+// CHECK:    Succs (1): B1
+// CHECK:  [B3]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A c;
+// CHECK:    3: [B3.2].~A() (Implicit destructor)
+// CHECK:    Succs (1): B1
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (1): B1
+// CHECK:  [B9 (ENTRY)]
+// CHECK:    Succs (1): B2
+// CHECK:  [B1]
+// CHECK:    1: [B2.6].~A() (Implicit destructor)
+// CHECK:    2:  (CXXConstructExpr, class A)
+// CHECK:    3: A g;
+// CHECK:    4: [B1.3].~A() (Implicit destructor)
+// CHECK:    5: [B2.2].~A() (Implicit destructor)
+// CHECK:    Preds (3): B3 B7 B2
+// CHECK:    Succs (1): B0
+// CHECK:  [B2]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    3: a
+// CHECK:    4: [B2.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    5: [B2.4] (CXXConstructExpr, class A)
+// CHECK:    6: A b = a;
+// CHECK:    7: b
+// CHECK:    8: [B2.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    9: [B2.8].operator int
+// CHECK:   10: [B2.9]()
+// CHECK:   11: [B2.10] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:    T: switch [B2.11]
+// CHECK:    Preds (1): B9
+// CHECK:    Succs (3): B3 B8
 // CHECK:      B1
-// CHECK:  [ B3 ]
-// CHECK:     case 1:
-// CHECK:       T: break;
-// CHECK:     Predecessors (2): B2 B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B4 ]
-// CHECK:       1: 
-// CHECK:       2: A f;
-// CHECK:       3: [B4.2].~A() (Implicit destructor)
-// CHECK:       4: [B8.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B6
-// CHECK:     Successors (1): B3
-// CHECK:  [ B5 ]
-// CHECK:       1: return;
-// CHECK:       2: [B8.2].~A() (Implicit destructor)
-// CHECK:       3: [B2.6].~A() (Implicit destructor)
-// CHECK:       4: [B2.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B6
-// CHECK:     Successors (1): B0
-// CHECK:  [ B6 ]
-// CHECK:       1: UV
-// CHECK:       2: [B6.1]
-// CHECK:       T: if [B6.2]
-// CHECK:     Predecessors (1): B8
-// CHECK:     Successors (2): B5 B4
-// CHECK:  [ B7 ]
-// CHECK:       1: [B8.2].~A() (Implicit destructor)
-// CHECK:       T: break;
-// CHECK:     Predecessors (1): B8
-// CHECK:     Successors (1): B1
-// CHECK:  [ B8 ]
-// CHECK:     case 0:
-// CHECK:       1: 
-// CHECK:       2: A c;
-// CHECK:       3: UV
-// CHECK:       4: [B8.3]
-// CHECK:       T: if [B8.4]
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (2): B7 B6
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (2): B1 B5
-// CHECK:     Successors (0):
-// CHECK:  [ B6 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B5
-// CHECK:  [ B1 ]
-// CHECK:       1: [B2.4].~A() (Implicit destructor)
-// CHECK:       2: [B5.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: a
-// CHECK:       2: [B2.1]
-// CHECK:       3: [B2.2]
-// CHECK:       4: A b = a;
-// CHECK:       5: b
-// CHECK:       6: [B2.5]
-// CHECK:       7: [B2.6].operator int
-// CHECK:       8: [B2.7]()
-// CHECK:       9: [B2.8]
-// CHECK:      10: [B2.9]
-// CHECK:       T: for (...; [B2.10]; )
-// CHECK:     Predecessors (2): B3 B5
-// CHECK:     Successors (2): B4 B1
-// CHECK:  [ B3 ]
-// CHECK:       1: [B2.4].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B2
-// CHECK:  [ B4 ]
-// CHECK:       1: 
-// CHECK:       2: A c;
-// CHECK:       3: [B4.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B3
-// CHECK:  [ B5 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:     Predecessors (1): B6
-// CHECK:     Successors (1): B2
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B12 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B11
-// CHECK:  [ B1 ]
-// CHECK:       1: [B2.4].~A() (Implicit destructor)
-// CHECK:       2: [B11.4].~A() (Implicit destructor)
-// CHECK:       3: 
-// CHECK:       4: A f;
-// CHECK:       5: [B1.4].~A() (Implicit destructor)
-// CHECK:       6: [B11.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (2): B9 B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: b
-// CHECK:       2: [B2.1]
-// CHECK:       3: [B2.2]
-// CHECK:       4: A c = b;
-// CHECK:       5: c
-// CHECK:       6: [B2.5]
-// CHECK:       7: [B2.6].operator int
-// CHECK:       8: [B2.7]()
-// CHECK:       9: [B2.8]
-// CHECK:      10: [B2.9]
-// CHECK:       T: for (...; [B2.10]; )
-// CHECK:     Predecessors (2): B3 B11
-// CHECK:     Successors (2): B10 B1
-// CHECK:  [ B3 ]
-// CHECK:       1: [B2.4].~A() (Implicit destructor)
-// CHECK:     Predecessors (2): B4 B7
-// CHECK:     Successors (1): B2
-// CHECK:  [ B4 ]
-// CHECK:       1: 
-// CHECK:       2: A e;
-// CHECK:       3: [B4.2].~A() (Implicit destructor)
-// CHECK:       4: [B10.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B6
-// CHECK:     Successors (1): B3
-// CHECK:  [ B5 ]
-// CHECK:       1: return;
-// CHECK:       2: [B10.2].~A() (Implicit destructor)
-// CHECK:       3: [B2.4].~A() (Implicit destructor)
-// CHECK:       4: [B11.4].~A() (Implicit destructor)
-// CHECK:       5: [B11.2].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B6
-// CHECK:     Successors (1): B0
-// CHECK:  [ B6 ]
-// CHECK:       1: UV
-// CHECK:       2: [B6.1]
-// CHECK:       T: if [B6.2]
-// CHECK:     Predecessors (1): B8
-// CHECK:     Successors (2): B5 B4
-// CHECK:  [ B7 ]
-// CHECK:       1: [B10.2].~A() (Implicit destructor)
-// CHECK:       T: continue;
-// CHECK:     Predecessors (1): B8
-// CHECK:     Successors (1): B3
-// CHECK:  [ B8 ]
-// CHECK:       1: UV
-// CHECK:       2: [B8.1]
-// CHECK:       T: if [B8.2]
-// CHECK:     Predecessors (1): B10
-// CHECK:     Successors (2): B7 B6
-// CHECK:  [ B9 ]
-// CHECK:       1: [B10.2].~A() (Implicit destructor)
-// CHECK:       T: break;
-// CHECK:     Predecessors (1): B10
-// CHECK:     Successors (1): B1
-// CHECK:  [ B10 ]
-// CHECK:       1: 
-// CHECK:       2: A d;
-// CHECK:       3: UV
-// CHECK:       4: [B10.3]
-// CHECK:       T: if [B10.4]
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (2): B9 B8
-// CHECK:  [ B11 ]
-// CHECK:       1: 
-// CHECK:       2: A a;
-// CHECK:       3: 
-// CHECK:       4: A b;
-// CHECK:     Predecessors (1): B12
-// CHECK:     Successors (1): B2
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (2): B1 B5
-// CHECK:     Successors (0):
-// CHECK:  [ B3 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B0
-// CHECK:  [ B1 ]
-// CHECK:       T: try ...
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (2): B2 B0
-// CHECK:  [ B2 ]
-// CHECK:     catch (const A &e):
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (3): B2 B1 B3
-// CHECK:     Successors (0):
-// CHECK:  [ B3 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B0
-// CHECK:  [ B1 ]
-// CHECK:       T: try ...
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (2): B2 B0
-// CHECK:  [ B2 ]
-// CHECK:     catch (A e):
-// CHECK:       1: .~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (3): B2 B1 B3
-// CHECK:     Successors (0):
+// CHECK:  [B3]
+// CHECK:   case 1:
+// CHECK:    T: break;
+// CHECK:    Preds (2): B2 B4
+// CHECK:    Succs (1): B1
+// CHECK:  [B4]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A f;
+// CHECK:    3: [B4.2].~A() (Implicit destructor)
+// CHECK:    4: [B8.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B6
+// CHECK:    Succs (1): B3
+// CHECK:  [B5]
+// CHECK:    1: return;
+// CHECK:    2: [B8.2].~A() (Implicit destructor)
+// CHECK:    3: [B2.6].~A() (Implicit destructor)
+// CHECK:    4: [B2.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B6
+// CHECK:    Succs (1): B0
+// CHECK:  [B6]
+// CHECK:    1: UV
+// CHECK:    2: [B6.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B6.2]
+// CHECK:    Preds (1): B8
+// CHECK:    Succs (2): B5 B4
+// CHECK:  [B7]
+// CHECK:    1: [B8.2].~A() (Implicit destructor)
+// CHECK:    T: break;
+// CHECK:    Preds (1): B8
+// CHECK:    Succs (1): B1
+// CHECK:  [B8]
+// CHECK:   case 0:
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A c;
+// CHECK:    3: UV
+// CHECK:    4: [B8.3] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B8.4]
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (2): B7 B6
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (2): B1 B5
+// CHECK:  [B6 (ENTRY)]
+// CHECK:    Succs (1): B5
+// CHECK:  [B1]
+// CHECK:    1: [B2.4].~A() (Implicit destructor)
+// CHECK:    2: [B5.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (1): B0
+// CHECK:  [B2]
+// CHECK:    1: a
+// CHECK:    2: [B2.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    3: [B2.2] (CXXConstructExpr, class A)
+// CHECK:    4: A b = a;
+// CHECK:    5: b
+// CHECK:    6: [B2.5] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    7: [B2.6].operator int
+// CHECK:    8: [B2.7]()
+// CHECK:    9: [B2.8] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:   10: [B2.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK:    T: for (...; [B2.10]; )
+// CHECK:    Preds (2): B3 B5
+// CHECK:    Succs (2): B4 B1
+// CHECK:  [B3]
+// CHECK:    1: [B2.4].~A() (Implicit destructor)
+// CHECK:    Preds (1): B4
+// CHECK:    Succs (1): B2
+// CHECK:  [B4]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A c;
+// CHECK:    3: [B4.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (1): B3
+// CHECK:  [B5]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    Preds (1): B6
+// CHECK:    Succs (1): B2
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (1): B1
+// CHECK:  [B12 (ENTRY)]
+// CHECK:    Succs (1): B11
+// CHECK:  [B1]
+// CHECK:    1: [B2.4].~A() (Implicit destructor)
+// CHECK:    2: [B11.4].~A() (Implicit destructor)
+// CHECK:    3:  (CXXConstructExpr, class A)
+// CHECK:    4: A f;
+// CHECK:    5: [B1.4].~A() (Implicit destructor)
+// CHECK:    6: [B11.2].~A() (Implicit destructor)
+// CHECK:    Preds (2): B9 B2
+// CHECK:    Succs (1): B0
+// CHECK:  [B2]
+// CHECK:    1: b
+// CHECK:    2: [B2.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    3: [B2.2] (CXXConstructExpr, class A)
+// CHECK:    4: A c = b;
+// CHECK:    5: c
+// CHECK:    6: [B2.5] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    7: [B2.6].operator int
+// CHECK:    8: [B2.7]()
+// CHECK:    9: [B2.8] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:   10: [B2.9] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK:    T: for (...; [B2.10]; )
+// CHECK:    Preds (2): B3 B11
+// CHECK:    Succs (2): B10 B1
+// CHECK:  [B3]
+// CHECK:    1: [B2.4].~A() (Implicit destructor)
+// CHECK:    Preds (2): B4 B7
+// CHECK:    Succs (1): B2
+// CHECK:  [B4]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A e;
+// CHECK:    3: [B4.2].~A() (Implicit destructor)
+// CHECK:    4: [B10.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B6
+// CHECK:    Succs (1): B3
+// CHECK:  [B5]
+// CHECK:    1: return;
+// CHECK:    2: [B10.2].~A() (Implicit destructor)
+// CHECK:    3: [B2.4].~A() (Implicit destructor)
+// CHECK:    4: [B11.4].~A() (Implicit destructor)
+// CHECK:    5: [B11.2].~A() (Implicit destructor)
+// CHECK:    Preds (1): B6
+// CHECK:    Succs (1): B0
+// CHECK:  [B6]
+// CHECK:    1: UV
+// CHECK:    2: [B6.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B6.2]
+// CHECK:    Preds (1): B8
+// CHECK:    Succs (2): B5 B4
+// CHECK:  [B7]
+// CHECK:    1: [B10.2].~A() (Implicit destructor)
+// CHECK:    T: continue;
+// CHECK:    Preds (1): B8
+// CHECK:    Succs (1): B3
+// CHECK:  [B8]
+// CHECK:    1: UV
+// CHECK:    2: [B8.1] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B8.2]
+// CHECK:    Preds (1): B10
+// CHECK:    Succs (2): B7 B6
+// CHECK:  [B9]
+// CHECK:    1: [B10.2].~A() (Implicit destructor)
+// CHECK:    T: break;
+// CHECK:    Preds (1): B10
+// CHECK:    Succs (1): B1
+// CHECK:  [B10]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A d;
+// CHECK:    3: UV
+// CHECK:    4: [B10.3] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: if [B10.4]
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (2): B9 B8
+// CHECK:  [B11]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A a;
+// CHECK:    3:  (CXXConstructExpr, class A)
+// CHECK:    4: A b;
+// CHECK:    Preds (1): B12
+// CHECK:    Succs (1): B2
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (2): B1 B5
+// CHECK:  [B3 (ENTRY)]
+// CHECK:    Succs (1): B0
+// CHECK:  [B1]
+// CHECK:    T: try ...
+// CHECK:    Succs (2): B2 B0
+// CHECK:  [B2]
+// CHECK:   catch (const A &e):
+// CHECK:    Preds (1): B1
+// CHECK:    Succs (1): B0
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (3): B2 B1 B3
+// CHECK:  [B3 (ENTRY)]
+// CHECK:    Succs (1): B0
+// CHECK:  [B1]
+// CHECK:    T: try ...
+// CHECK:    Succs (2): B2 B0
+// CHECK:  [B2]
+// CHECK:   catch (A e):
+// CHECK:    1: .~A() (Implicit destructor)
+// CHECK:    Preds (1): B1
+// CHECK:    Succs (1): B0
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (3): B2 B1 B3
+
 

Modified: cfe/branches/tooling/test/Analysis/dead-stores.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/dead-stores.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/dead-stores.c (original)
+++ cfe/branches/tooling/test/Analysis/dead-stores.c Fri Jan 20 10:14:22 2012
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores,deadcode.IdempotentOperations -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s
-// RUN: %clang_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores,deadcode.IdempotentOperations -analyzer-store=region -analyzer-constraints=basic -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s
-// RUN: %clang_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores,deadcode.IdempotentOperations -analyzer-store=region -analyzer-constraints=range -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s
+// RUN: %clang_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores,experimental.deadcode.IdempotentOperations -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s
+// RUN: %clang_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores,experimental.deadcode.IdempotentOperations -analyzer-store=region -analyzer-constraints=basic -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s
+// RUN: %clang_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores,experimental.deadcode.IdempotentOperations -analyzer-store=region -analyzer-constraints=range -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s
 
 void f1() {
   int k, y; // expected-warning{{unused variable 'k'}} expected-warning{{unused variable 'y'}}

Modified: cfe/branches/tooling/test/Analysis/dead-stores.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/dead-stores.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/dead-stores.m (original)
+++ cfe/branches/tooling/test/Analysis/dead-stores.m Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.core -analyzer-checker=deadcode.DeadStores,osx.cocoa.RetainCount -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.core -analyzer-checker=deadcode.DeadStores,osx.cocoa.RetainCount -fblocks -verify %s
 
 typedef signed char BOOL;
 typedef unsigned int NSUInteger;
@@ -76,3 +76,15 @@
 }
 @end
 
+// Don't flag dead stores when a variable is captured in a block used
+// by a property access.
+ at interface RDar10591355
+ at property (assign) int x;
+ at end
+
+RDar10591355 *rdar10591355_aux();
+
+void rdar10591355() {
+  RDar10591355 *p = rdar10591355_aux();
+  ^{ (void) p.x; }();
+}

Modified: cfe/branches/tooling/test/Analysis/dtors-in-dtor-cfg-output.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/dtors-in-dtor-cfg-output.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/dtors-in-dtor-cfg-output.cpp (original)
+++ cfe/branches/tooling/test/Analysis/dtors-in-dtor-cfg-output.cpp Fri Jan 20 10:14:22 2012
@@ -35,26 +35,22 @@
 
 TestArray::~TestArray() {}
 
-// CHECK:  [ B2 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B1 ]
-// CHECK:       1: this->a.~A() (Member object destructor)
-// CHECK:       2: ~B() (Base object destructor)
-// CHECK:       3: ~C() (Base object destructor)
-// CHECK:       4: ~A() (Base object destructor)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B2 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B1 ]
-// CHECK:       1: this->a.~A() (Member object destructor)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
+// CHECK:  [B2 (ENTRY)]
+// CHECK:    Succs (1): B1
+// CHECK:  [B1]
+// CHECK:    1: this->a.~A() (Member object destructor)
+// CHECK:    2: ~B() (Base object destructor)
+// CHECK:    3: ~C() (Base object destructor)
+// CHECK:    4: ~A() (Base object destructor)
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (1): B0
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (1): B1
+// CHECK:  [B2 (ENTRY)]
+// CHECK:    Succs (1): B1
+// CHECK:  [B1]
+// CHECK:    1: this->a.~A() (Member object destructor)
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (1): B0
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (1): B1

Modified: cfe/branches/tooling/test/Analysis/idempotent-operations-limited-loops.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/idempotent-operations-limited-loops.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/idempotent-operations-limited-loops.c (original)
+++ cfe/branches/tooling/test/Analysis/idempotent-operations-limited-loops.c Fri Jan 20 10:14:22 2012
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=core,deadcode.IdempotentOperations -analyzer-max-loop 3 -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=core,deadcode.IdempotentOperations -analyzer-max-loop 4 -verify %s
-// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=core,deadcode.IdempotentOperations %s -verify
+// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=core,experimental.deadcode.IdempotentOperations -analyzer-max-loop 3 -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=core,experimental.deadcode.IdempotentOperations -analyzer-max-loop 4 -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=core,experimental.deadcode.IdempotentOperations %s -verify
 
 void always_warning() { int *p = 0; *p = 0xDEADBEEF; } // expected-warning{{Dereference of null pointer (loaded from variable 'p')}}
 

Modified: cfe/branches/tooling/test/Analysis/idempotent-operations.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/idempotent-operations.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/idempotent-operations.c (original)
+++ cfe/branches/tooling/test/Analysis/idempotent-operations.c Fri Jan 20 10:14:22 2012
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=deadcode.IdempotentOperations -verify %s
-// RUN: %clang --analyze -Xclang -analyzer-disable-checker=deadcode.DeadStores -fblocks -Xclang -verify %s -o %t
+// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=experimental.deadcode.IdempotentOperations -verify %s
 
 // Basic tests
 

Modified: cfe/branches/tooling/test/Analysis/idempotent-operations.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/idempotent-operations.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/idempotent-operations.cpp (original)
+++ cfe/branches/tooling/test/Analysis/idempotent-operations.cpp Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=deadcode.IdempotentOperations -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=experimental.deadcode.IdempotentOperations -verify %s
 
 // C++ specific false positives
 

Modified: cfe/branches/tooling/test/Analysis/idempotent-operations.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/idempotent-operations.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/idempotent-operations.m (original)
+++ cfe/branches/tooling/test/Analysis/idempotent-operations.m Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=deadcode.IdempotentOperations,osx.cocoa.RetainCount -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=experimental.deadcode.IdempotentOperations,osx.cocoa.RetainCount -verify %s
 
 typedef signed char BOOL;
 typedef unsigned long NSUInteger;

Modified: cfe/branches/tooling/test/Analysis/initializers-cfg-output.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/initializers-cfg-output.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/initializers-cfg-output.cpp (original)
+++ cfe/branches/tooling/test/Analysis/initializers-cfg-output.cpp Fri Jan 20 10:14:22 2012
@@ -44,60 +44,55 @@
   int v;
 }
 
-// CHECK:  [ B2 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B1 ]
-// CHECK:       1: 
-// CHECK:       2: A([B1.1]) (Base initializer)
-// CHECK:       3: 
-// CHECK:       4: C([B1.3]) (Base initializer)
-// CHECK:       5: 
-// CHECK:       6: B([B1.5]) (Base initializer)
-// CHECK:       7: 
-// CHECK:       8: A([B1.7]) (Base initializer)
-// CHECK:       9: /*implicit*/int()
-// CHECK:      10: i([B1.9]) (Member initializer)
-// CHECK:      11: this
-// CHECK:      12: [B1.11]->i
-// CHECK:      13: r([B1.12]) (Member initializer)
-// CHECK:      14: 
-// CHECK:      15: A a;
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B5 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B4
-// CHECK:  [ B1 ]
-// CHECK:       1: [B4.4] ? [B2.1] : [B3.1]
-// CHECK:       2: y([B1.1]) (Member initializer)
-// CHECK:       3: this
-// CHECK:       4: [B1.3]->y
-// CHECK:       5: [B1.4]
-// CHECK:       6: z([B1.5]) (Member initializer)
-// CHECK:       7: int v;
-// CHECK:     Predecessors (2): B2 B3
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: 0
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B3 ]
-// CHECK:       1: 1
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B4 ]
-// CHECK:       1: 0
-// CHECK:       2: x([B4.1]) (Member initializer)
-// CHECK:       3: b
-// CHECK:       4: [B4.3]
-// CHECK:       T: [B4.4] ? ... : ...
-// CHECK:     Predecessors (1): B5
-// CHECK:     Successors (2): B2 B3
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-
+// CHECK:  [B2 (ENTRY)]
+// CHECK:    Succs (1): B1
+// CHECK:  [B1]
+// CHECK:    1:  (CXXConstructExpr, class A)
+// CHECK:    2: A([B1.1]) (Base initializer)
+// CHECK:    3:  (CXXConstructExpr, class C)
+// CHECK:    4: C([B1.3]) (Base initializer)
+// CHECK:    5:  (CXXConstructExpr, class B)
+// CHECK:    6: B([B1.5]) (Base initializer)
+// CHECK:    7:  (CXXConstructExpr, class A)
+// CHECK:    8: A([B1.7]) (Base initializer)
+// CHECK:    9: /*implicit*/int()
+// CHECK:   10: i([B1.9]) (Member initializer)
+// CHECK:   11: this
+// CHECK:   12: [B1.11]->i
+// CHECK:   13: r([B1.12]) (Member initializer)
+// CHECK:   14:  (CXXConstructExpr, class A)
+// CHECK:   15: A a;
+// CHECK:    Preds (1): B2
+// CHECK:    Succs (1): B0
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (1): B1
+// CHECK:  [B5 (ENTRY)]
+// CHECK:    Succs (1): B4
+// CHECK:  [B1]
+// CHECK:    1: [B4.4] ? [B2.1] : [B3.1]
+// CHECK:    2: y([B1.1]) (Member initializer)
+// CHECK:    3: this
+// CHECK:    4: [B1.3]->y
+// CHECK:    5: [B1.4] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK:    6: z([B1.5]) (Member initializer)
+// CHECK:    7: int v;
+// CHECK:    Preds (2): B2 B3
+// CHECK:    Succs (1): B0
+// CHECK:  [B2]
+// CHECK:    1: 0
+// CHECK:    Preds (1): B4
+// CHECK:    Succs (1): B1
+// CHECK:  [B3]
+// CHECK:    1: 1
+// CHECK:    Preds (1): B4
+// CHECK:    Succs (1): B1
+// CHECK:  [B4]
+// CHECK:    1: 0
+// CHECK:    2: x([B4.1]) (Member initializer)
+// CHECK:    3: b
+// CHECK:    4: [B4.3] (ImplicitCastExpr, LValueToRValue, _Bool)
+// CHECK:    T: [B4.4] ? ... : ...
+// CHECK:    Preds (1): B5
+// CHECK:    Succs (2): B2 B3
+// CHECK:  [B0 (EXIT)]
+// CHECK:    Preds (1): B1

Modified: cfe/branches/tooling/test/Analysis/inline.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/inline.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/inline.c (original)
+++ cfe/branches/tooling/test/Analysis/inline.c Fri Jan 20 10:14:22 2012
@@ -1,5 +1,4 @@
 // RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-inline-call -analyzer-store region -verify %s
-// XFAIL: *
 
 int test1_f1() {
   int y = 1;
@@ -29,3 +28,33 @@
   test2_f1(test2_f2()); // expected-warning{{too many arguments in call to 'test2_f1'}}
 }
 
+// Test that inlining works with recursive functions.
+
+unsigned factorial(unsigned x) {
+  if (x <= 1)
+    return 1;
+  return x * factorial(x - 1);
+}
+
+void test_factorial() {
+  if (factorial(3) == 6) {
+    int *p = 0;
+    *p = 0xDEADBEEF;  // expected-warning {{null}}
+  }
+  else {
+    int *p = 0;
+    *p = 0xDEADBEEF; // no-warning
+  }
+}
+
+void test_factorial_2() {
+  unsigned x = factorial(3);
+  if (x == factorial(3)) {
+    int *p = 0;
+    *p = 0xDEADBEEF;  // expected-warning {{null}}
+  }
+  else {
+    int *p = 0;
+    *p = 0xDEADBEEF; // no-warning
+  }
+}

Modified: cfe/branches/tooling/test/Analysis/misc-ps-region-store.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/misc-ps-region-store.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/misc-ps-region-store.m (original)
+++ cfe/branches/tooling/test/Analysis/misc-ps-region-store.m Fri Jan 20 10:14:22 2012
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,experimental.core.CastToStruct,experimental.security.ReturnPtrRange,experimental.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -DTEST_64 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,experimental.core.CastToStruct,experimental.security.ReturnPtrRange,experimental.security.ArrayBound -analyzer-store=region -verify -fblocks   -analyzer-opt-analyze-nested-blocks %s
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,experimental.deadcode.IdempotentOperations,experimental.core.CastToStruct,experimental.security.ReturnPtrRange,experimental.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -DTEST_64 -analyze -analyzer-checker=core,experimental.deadcode.IdempotentOperations,experimental.core.CastToStruct,experimental.security.ReturnPtrRange,experimental.security.ArrayBound -analyzer-store=region -verify -fblocks   -analyzer-opt-analyze-nested-blocks %s
 
 typedef long unsigned int size_t;
 void *memcpy(void *, const void *, size_t);
@@ -918,7 +918,7 @@
 
 void pr6302(id x, Class y) {
   // This previously crashed the analyzer (reported in PR 6302)
-  x->isa  = y;
+  x->isa  = y; // expected-warning {{direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()}}
 }
 
 //===----------------------------------------------------------------------===//

Modified: cfe/branches/tooling/test/Analysis/misc-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/misc-ps.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/misc-ps.c (original)
+++ cfe/branches/tooling/test/Analysis/misc-ps.c Fri Jan 20 10:14:22 2012
@@ -1,24 +1,6 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -disable-free -analyzer-eagerly-assume -analyzer-checker=core -analyzer-checker=deadcode -verify %s
 
-unsigned long strlen(const char *);
-
 int size_rdar9373039 = 1;
-int rdar9373039() {
-  int x;
-  int j = 0;
-
-  for (int i = 0 ; i < size_rdar9373039 ; ++i)
-    x = 1;
-    
-  // strlen doesn't invalidate the value of 'size_rdar9373039'.
-  int extra = (2 + strlen ("Clang") + ((4 - ((unsigned int) (2 + strlen ("Clang")) % 4)) % 4)) + (2 + strlen ("1.0") + ((4 - ((unsigned int) (2 + strlen ("1.0")) % 4)) % 4));
-
-  for (int i = 0 ; i < size_rdar9373039 ; ++i)
-    j += x; // no-warning
-
-  return j;
-}
-
 int foo_rdar9373039(const char *);
 
 int rdar93730392() {

Modified: cfe/branches/tooling/test/Analysis/misc-ps.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/misc-ps.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/misc-ps.m (original)
+++ cfe/branches/tooling/test/Analysis/misc-ps.m Fri Jan 20 10:14:22 2012
@@ -1,11 +1,11 @@
 // NOTE: Use '-fobjc-gc' to test the analysis being run twice, and multiple reports are not issued.
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,experimental.core,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,experimental.core,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,experimental.core,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,deadcode.IdempotentOperations,experimental.core,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,experimental.deadcode.IdempotentOperations,experimental.core,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,experimental.deadcode.IdempotentOperations,experimental.core,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,experimental.deadcode.IdempotentOperations,experimental.core,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=basic -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,experimental.deadcode.IdempotentOperations,experimental.core,osx.cocoa.AtSync -analyzer-store=region -analyzer-constraints=range -verify -fblocks -Wno-unreachable-code -Wno-null-dereference %s
 
 #ifndef __clang_analyzer__
-#error __clang__analyzer__ not defined
+#error __clang_analyzer__ not defined
 #endif
 
 typedef struct objc_ivar *Ivar;
@@ -274,6 +274,17 @@
   *p = 1; // expected-warning{{Dereference of null pointer}}  
 }
 
+// Check that the pointer-to-conts arguments do not get invalidated by Obj C 
+// interfaces. radar://10595327
+int rdar_10595327(char *str) {
+  char fl = str[0]; 
+  int *p = 0;
+  NSString *s = [NSString stringWithUTF8String:str];
+  if (str[0] != fl)
+      return *p; // no-warning
+  return 0;
+}
+
 // For pointer arithmetic, --/++ should be treated as preserving non-nullness,
 // regardless of how well the underlying StoreManager reasons about pointer
 // arithmetic.

Modified: cfe/branches/tooling/test/Analysis/null-deref-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/null-deref-ps.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/null-deref-ps.c (original)
+++ cfe/branches/tooling/test/Analysis/null-deref-ps.c Fri Jan 20 10:14:22 2012
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -analyzer-purge=none -verify %s -Wreturn-type
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -verify %s -Wreturn-type 
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.deadcode.IdempotentOperations,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -analyzer-purge=none -verify %s -Wreturn-type
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.deadcode.IdempotentOperations,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -verify %s -Wreturn-type 
 
 typedef unsigned uintptr_t;
 
@@ -289,4 +289,25 @@
   pr4759_aux(p); // expected-warning{{Function call argument is an uninitialized value}}
 }
 
-
+// Relax function call arguments invalidation to be aware of const
+// arguments. Test with function pointers. radar://10595327
+void ttt(const int *nptr);
+void ttt2(const int *nptr);
+typedef void (*NoConstType)(int*);
+int foo10595327(int b) {
+  void (*fp)(int *);
+  // We use path sensitivity to get the function declaration. Even when the
+  // function pointer is cast to non pointer-to-const parameter type, we can
+  // find the right function declaration.
+  if (b > 5)
+    fp = (NoConstType)ttt2;
+  else
+    fp = (NoConstType)ttt;
+  int x = 3;
+  int y = x + 1;
+  int *p = 0;
+  fp(&y);
+  if (x == y)
+      return *p; // no-warning
+  return 0;
+}

Modified: cfe/branches/tooling/test/Analysis/plist-output.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/plist-output.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/plist-output.m (original)
+++ cfe/branches/tooling/test/Analysis/plist-output.m Fri Jan 20 10:14:22 2012
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-output=plist -o - %s | FileCheck %s
-// XFAIL: *
+// RUN: %clang --analyze %s -o %t > /dev/null 2>&1
+// RUN: FileCheck -input-file %t %s
 
 void test_null_init(void) {
   int *p = 0;
@@ -38,6 +38,26 @@
   *(x.p) = 0xDEADBEEF;
 }
 
+void test_assumptions(int a, int b)
+{
+  if (a == 0) {
+    return;
+  }
+  if (b != 0) {
+    return;
+  }
+  int *p = 0;
+  *p = 0xDEADBEEF;
+}
+
+int *bar_cond_assign();
+int test_cond_assign() { 
+  int *p;
+  if (p = bar_cond_assign())
+    return 1;
+  return *p;
+}
+
 // CHECK: <?xml version="1.0" encoding="UTF-8"?>
 // CHECK: <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 // CHECK: <plist version="1.0">
@@ -51,34 +71,6 @@
 // CHECK:    <key>path</key>
 // CHECK:    <array>
 // CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>4</integer>
-// CHECK:       <key>col</key><integer>3</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>4</integer>
-// CHECK:          <key>col</key><integer>3</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>4</integer>
-// CHECK:          <key>col</key><integer>8</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Variable 'p' initialized to a null pointer value</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Variable 'p' initialized to a null pointer value</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
 // CHECK:      <key>kind</key><string>control</string>
 // CHECK:      <key>edges</key>
 // CHECK:       <array>
@@ -86,25 +78,25 @@
 // CHECK:         <key>start</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>4</integer>
+// CHECK:            <key>line</key><integer>5</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>4</integer>
-// CHECK:            <key>col</key><integer>8</integer>
+// CHECK:            <key>line</key><integer>5</integer>
+// CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:          </array>
 // CHECK:         <key>end</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>5</integer>
+// CHECK:            <key>line</key><integer>6</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>5</integer>
+// CHECK:            <key>line</key><integer>6</integer>
 // CHECK:            <key>col</key><integer>4</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
@@ -116,7 +108,7 @@
 // CHECK:      <key>kind</key><string>event</string>
 // CHECK:      <key>location</key>
 // CHECK:      <dict>
-// CHECK:       <key>line</key><integer>5</integer>
+// CHECK:       <key>line</key><integer>6</integer>
 // CHECK:       <key>col</key><integer>3</integer>
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
@@ -124,12 +116,12 @@
 // CHECK:      <array>
 // CHECK:        <array>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>5</integer>
+// CHECK:          <key>line</key><integer>6</integer>
 // CHECK:          <key>col</key><integer>4</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>5</integer>
+// CHECK:          <key>line</key><integer>6</integer>
 // CHECK:          <key>col</key><integer>4</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
@@ -146,7 +138,7 @@
 // CHECK:    <key>type</key><string>Dereference of null pointer</string>
 // CHECK:   <key>location</key>
 // CHECK:   <dict>
-// CHECK:    <key>line</key><integer>5</integer>
+// CHECK:    <key>line</key><integer>6</integer>
 // CHECK:    <key>col</key><integer>3</integer>
 // CHECK:    <key>file</key><integer>0</integer>
 // CHECK:   </dict>
@@ -162,12 +154,12 @@
 // CHECK:         <key>start</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>9</integer>
+// CHECK:            <key>line</key><integer>10</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>9</integer>
+// CHECK:            <key>line</key><integer>10</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
@@ -175,13 +167,13 @@
 // CHECK:         <key>end</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>10</integer>
+// CHECK:            <key>line</key><integer>12</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>10</integer>
-// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>line</key><integer>12</integer>
+// CHECK:            <key>col</key><integer>4</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:          </array>
@@ -192,7 +184,7 @@
 // CHECK:      <key>kind</key><string>event</string>
 // CHECK:      <key>location</key>
 // CHECK:      <dict>
-// CHECK:       <key>line</key><integer>10</integer>
+// CHECK:       <key>line</key><integer>12</integer>
 // CHECK:       <key>col</key><integer>3</integer>
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
@@ -200,22 +192,36 @@
 // CHECK:      <array>
 // CHECK:        <array>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>10</integer>
-// CHECK:          <key>col</key><integer>3</integer>
+// CHECK:          <key>line</key><integer>12</integer>
+// CHECK:          <key>col</key><integer>4</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>10</integer>
-// CHECK:          <key>col</key><integer>7</integer>
+// CHECK:          <key>line</key><integer>12</integer>
+// CHECK:          <key>col</key><integer>4</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:        </array>
 // CHECK:      </array>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Null pointer value stored to 'p'</string>
+// CHECK:      <string>Dereference of null pointer (loaded from variable 'p')</string>
 // CHECK:      <key>message</key>
-// CHECK: <string>Null pointer value stored to 'p'</string>
+// CHECK: <string>Dereference of null pointer (loaded from variable 'p')</string>
 // CHECK:     </dict>
+// CHECK:    </array>
+// CHECK:    <key>description</key><string>Dereference of null pointer (loaded from variable 'p')</string>
+// CHECK:    <key>category</key><string>Logic error</string>
+// CHECK:    <key>type</key><string>Dereference of null pointer</string>
+// CHECK:   <key>location</key>
+// CHECK:   <dict>
+// CHECK:    <key>line</key><integer>12</integer>
+// CHECK:    <key>col</key><integer>3</integer>
+// CHECK:    <key>file</key><integer>0</integer>
+// CHECK:   </dict>
+// CHECK:   </dict>
+// CHECK:   <dict>
+// CHECK:    <key>path</key>
+// CHECK:    <array>
 // CHECK:     <dict>
 // CHECK:      <key>kind</key><string>control</string>
 // CHECK:      <key>edges</key>
@@ -224,12 +230,12 @@
 // CHECK:         <key>start</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>10</integer>
+// CHECK:            <key>line</key><integer>16</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>10</integer>
+// CHECK:            <key>line</key><integer>16</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
@@ -237,12 +243,12 @@
 // CHECK:         <key>end</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>11</integer>
+// CHECK:            <key>line</key><integer>19</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>11</integer>
+// CHECK:            <key>line</key><integer>19</integer>
 // CHECK:            <key>col</key><integer>4</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
@@ -254,7 +260,7 @@
 // CHECK:      <key>kind</key><string>event</string>
 // CHECK:      <key>location</key>
 // CHECK:      <dict>
-// CHECK:       <key>line</key><integer>11</integer>
+// CHECK:       <key>line</key><integer>19</integer>
 // CHECK:       <key>col</key><integer>3</integer>
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
@@ -262,29 +268,29 @@
 // CHECK:      <array>
 // CHECK:        <array>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>11</integer>
+// CHECK:          <key>line</key><integer>19</integer>
 // CHECK:          <key>col</key><integer>4</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>11</integer>
+// CHECK:          <key>line</key><integer>19</integer>
 // CHECK:          <key>col</key><integer>4</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:        </array>
 // CHECK:      </array>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Dereference of null pointer (loaded from variable 'p')</string>
+// CHECK:      <string>Dereference of null pointer (loaded from variable 'q')</string>
 // CHECK:      <key>message</key>
-// CHECK: <string>Dereference of null pointer (loaded from variable 'p')</string>
+// CHECK: <string>Dereference of null pointer (loaded from variable 'q')</string>
 // CHECK:     </dict>
 // CHECK:    </array>
-// CHECK:    <key>description</key><string>Dereference of null pointer (loaded from variable 'p')</string>
+// CHECK:    <key>description</key><string>Dereference of null pointer (loaded from variable 'q')</string>
 // CHECK:    <key>category</key><string>Logic error</string>
 // CHECK:    <key>type</key><string>Dereference of null pointer</string>
 // CHECK:   <key>location</key>
 // CHECK:   <dict>
-// CHECK:    <key>line</key><integer>11</integer>
+// CHECK:    <key>line</key><integer>19</integer>
 // CHECK:    <key>col</key><integer>3</integer>
 // CHECK:    <key>file</key><integer>0</integer>
 // CHECK:   </dict>
@@ -300,12 +306,12 @@
 // CHECK:         <key>start</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>15</integer>
+// CHECK:            <key>line</key><integer>23</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>15</integer>
+// CHECK:            <key>line</key><integer>23</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
@@ -313,12 +319,12 @@
 // CHECK:         <key>end</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>17</integer>
-// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>line</key><integer>23</integer>
+// CHECK:            <key>col</key><integer>7</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>17</integer>
+// CHECK:            <key>line</key><integer>23</integer>
 // CHECK:            <key>col</key><integer>8</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
@@ -330,29 +336,29 @@
 // CHECK:      <key>kind</key><string>event</string>
 // CHECK:      <key>location</key>
 // CHECK:      <dict>
-// CHECK:       <key>line</key><integer>17</integer>
-// CHECK:       <key>col</key><integer>3</integer>
+// CHECK:       <key>line</key><integer>23</integer>
+// CHECK:       <key>col</key><integer>7</integer>
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
 // CHECK:      <key>ranges</key>
 // CHECK:      <array>
 // CHECK:        <array>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>17</integer>
-// CHECK:          <key>col</key><integer>3</integer>
+// CHECK:          <key>line</key><integer>23</integer>
+// CHECK:          <key>col</key><integer>7</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>17</integer>
+// CHECK:          <key>line</key><integer>23</integer>
 // CHECK:          <key>col</key><integer>8</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:        </array>
 // CHECK:      </array>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Variable 'q' initialized to a null pointer value</string>
+// CHECK:      <string>Assuming 'p' is null</string>
 // CHECK:      <key>message</key>
-// CHECK: <string>Variable 'q' initialized to a null pointer value</string>
+// CHECK: <string>Assuming 'p' is null</string>
 // CHECK:     </dict>
 // CHECK:     <dict>
 // CHECK:      <key>kind</key><string>control</string>
@@ -362,12 +368,12 @@
 // CHECK:         <key>start</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>17</integer>
-// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>line</key><integer>23</integer>
+// CHECK:            <key>col</key><integer>7</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>17</integer>
+// CHECK:            <key>line</key><integer>23</integer>
 // CHECK:            <key>col</key><integer>8</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
@@ -375,13 +381,13 @@
 // CHECK:         <key>end</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>18</integer>
-// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>line</key><integer>24</integer>
+// CHECK:            <key>col</key><integer>5</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>18</integer>
-// CHECK:            <key>col</key><integer>4</integer>
+// CHECK:            <key>line</key><integer>24</integer>
+// CHECK:            <key>col</key><integer>6</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:          </array>
@@ -392,38 +398,38 @@
 // CHECK:      <key>kind</key><string>event</string>
 // CHECK:      <key>location</key>
 // CHECK:      <dict>
-// CHECK:       <key>line</key><integer>18</integer>
-// CHECK:       <key>col</key><integer>3</integer>
+// CHECK:       <key>line</key><integer>24</integer>
+// CHECK:       <key>col</key><integer>5</integer>
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
 // CHECK:      <key>ranges</key>
 // CHECK:      <array>
 // CHECK:        <array>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>18</integer>
-// CHECK:          <key>col</key><integer>4</integer>
+// CHECK:          <key>line</key><integer>24</integer>
+// CHECK:          <key>col</key><integer>6</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>18</integer>
-// CHECK:          <key>col</key><integer>4</integer>
+// CHECK:          <key>line</key><integer>24</integer>
+// CHECK:          <key>col</key><integer>6</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:        </array>
 // CHECK:      </array>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Dereference of null pointer (loaded from variable 'q')</string>
+// CHECK:      <string>Dereference of null pointer (loaded from variable 'p')</string>
 // CHECK:      <key>message</key>
-// CHECK: <string>Dereference of null pointer (loaded from variable 'q')</string>
+// CHECK: <string>Dereference of null pointer (loaded from variable 'p')</string>
 // CHECK:     </dict>
 // CHECK:    </array>
-// CHECK:    <key>description</key><string>Dereference of null pointer (loaded from variable 'q')</string>
+// CHECK:    <key>description</key><string>Dereference of null pointer (loaded from variable 'p')</string>
 // CHECK:    <key>category</key><string>Logic error</string>
 // CHECK:    <key>type</key><string>Dereference of null pointer</string>
 // CHECK:   <key>location</key>
 // CHECK:   <dict>
-// CHECK:    <key>line</key><integer>18</integer>
-// CHECK:    <key>col</key><integer>3</integer>
+// CHECK:    <key>line</key><integer>24</integer>
+// CHECK:    <key>col</key><integer>5</integer>
 // CHECK:    <key>file</key><integer>0</integer>
 // CHECK:   </dict>
 // CHECK:   </dict>
@@ -438,12 +444,12 @@
 // CHECK:         <key>start</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>22</integer>
+// CHECK:            <key>line</key><integer>29</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>22</integer>
+// CHECK:            <key>line</key><integer>29</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
@@ -451,12 +457,12 @@
 // CHECK:         <key>end</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>22</integer>
+// CHECK:            <key>line</key><integer>29</integer>
 // CHECK:            <key>col</key><integer>7</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>22</integer>
+// CHECK:            <key>line</key><integer>29</integer>
 // CHECK:            <key>col</key><integer>8</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
@@ -468,7 +474,7 @@
 // CHECK:      <key>kind</key><string>event</string>
 // CHECK:      <key>location</key>
 // CHECK:      <dict>
-// CHECK:       <key>line</key><integer>22</integer>
+// CHECK:       <key>line</key><integer>29</integer>
 // CHECK:       <key>col</key><integer>7</integer>
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
@@ -476,21 +482,21 @@
 // CHECK:      <array>
 // CHECK:        <array>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>22</integer>
+// CHECK:          <key>line</key><integer>29</integer>
 // CHECK:          <key>col</key><integer>7</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>22</integer>
+// CHECK:          <key>line</key><integer>29</integer>
 // CHECK:          <key>col</key><integer>8</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:        </array>
 // CHECK:      </array>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Assuming pointer value is null</string>
+// CHECK:      <string>Assuming 'q' is null</string>
 // CHECK:      <key>message</key>
-// CHECK: <string>Assuming pointer value is null</string>
+// CHECK: <string>Assuming 'q' is null</string>
 // CHECK:     </dict>
 // CHECK:     <dict>
 // CHECK:      <key>kind</key><string>control</string>
@@ -500,12 +506,12 @@
 // CHECK:         <key>start</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>22</integer>
+// CHECK:            <key>line</key><integer>29</integer>
 // CHECK:            <key>col</key><integer>7</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>22</integer>
+// CHECK:            <key>line</key><integer>29</integer>
 // CHECK:            <key>col</key><integer>8</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
@@ -513,12 +519,46 @@
 // CHECK:         <key>end</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>23</integer>
+// CHECK:            <key>line</key><integer>30</integer>
 // CHECK:            <key>col</key><integer>5</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>23</integer>
+// CHECK:            <key>line</key><integer>30</integer>
+// CHECK:            <key>col</key><integer>5</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:        </dict>
+// CHECK:       </array>
+// CHECK:     </dict>
+// CHECK:     <dict>
+// CHECK:      <key>kind</key><string>control</string>
+// CHECK:      <key>edges</key>
+// CHECK:       <array>
+// CHECK:        <dict>
+// CHECK:         <key>start</key>
+// CHECK:          <array>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>30</integer>
+// CHECK:            <key>col</key><integer>5</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>30</integer>
+// CHECK:            <key>col</key><integer>5</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:         <key>end</key>
+// CHECK:          <array>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>31</integer>
+// CHECK:            <key>col</key><integer>5</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>31</integer>
 // CHECK:            <key>col</key><integer>6</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
@@ -530,7 +570,7 @@
 // CHECK:      <key>kind</key><string>event</string>
 // CHECK:      <key>location</key>
 // CHECK:      <dict>
-// CHECK:       <key>line</key><integer>23</integer>
+// CHECK:       <key>line</key><integer>31</integer>
 // CHECK:       <key>col</key><integer>5</integer>
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
@@ -538,12 +578,12 @@
 // CHECK:      <array>
 // CHECK:        <array>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>23</integer>
+// CHECK:          <key>line</key><integer>31</integer>
 // CHECK:          <key>col</key><integer>6</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>23</integer>
+// CHECK:          <key>line</key><integer>31</integer>
 // CHECK:          <key>col</key><integer>6</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
@@ -560,7 +600,7 @@
 // CHECK:    <key>type</key><string>Dereference of null pointer</string>
 // CHECK:   <key>location</key>
 // CHECK:   <dict>
-// CHECK:    <key>line</key><integer>23</integer>
+// CHECK:    <key>line</key><integer>31</integer>
 // CHECK:    <key>col</key><integer>5</integer>
 // CHECK:    <key>file</key><integer>0</integer>
 // CHECK:   </dict>
@@ -576,12 +616,12 @@
 // CHECK:         <key>start</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>28</integer>
+// CHECK:            <key>line</key><integer>36</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>28</integer>
+// CHECK:            <key>line</key><integer>36</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
@@ -589,12 +629,46 @@
 // CHECK:         <key>end</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>28</integer>
-// CHECK:            <key>col</key><integer>7</integer>
+// CHECK:            <key>line</key><integer>36</integer>
+// CHECK:            <key>col</key><integer>10</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>36</integer>
+// CHECK:            <key>col</key><integer>10</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:        </dict>
+// CHECK:       </array>
+// CHECK:     </dict>
+// CHECK:     <dict>
+// CHECK:      <key>kind</key><string>control</string>
+// CHECK:      <key>edges</key>
+// CHECK:       <array>
+// CHECK:        <dict>
+// CHECK:         <key>start</key>
+// CHECK:          <array>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>36</integer>
+// CHECK:            <key>col</key><integer>10</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>36</integer>
+// CHECK:            <key>col</key><integer>10</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:         <key>end</key>
+// CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>28</integer>
+// CHECK:            <key>line</key><integer>38</integer>
+// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>38</integer>
 // CHECK:            <key>col</key><integer>8</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
@@ -606,7 +680,83 @@
 // CHECK:      <key>kind</key><string>event</string>
 // CHECK:      <key>location</key>
 // CHECK:      <dict>
-// CHECK:       <key>line</key><integer>28</integer>
+// CHECK:       <key>line</key><integer>38</integer>
+// CHECK:       <key>col</key><integer>3</integer>
+// CHECK:       <key>file</key><integer>0</integer>
+// CHECK:      </dict>
+// CHECK:      <key>ranges</key>
+// CHECK:      <array>
+// CHECK:        <array>
+// CHECK:         <dict>
+// CHECK:          <key>line</key><integer>38</integer>
+// CHECK:          <key>col</key><integer>7</integer>
+// CHECK:          <key>file</key><integer>0</integer>
+// CHECK:         </dict>
+// CHECK:         <dict>
+// CHECK:          <key>line</key><integer>38</integer>
+// CHECK:          <key>col</key><integer>7</integer>
+// CHECK:          <key>file</key><integer>0</integer>
+// CHECK:         </dict>
+// CHECK:        </array>
+// CHECK:      </array>
+// CHECK:      <key>extended_message</key>
+// CHECK:      <string>Dereference of null pointer (loaded from field 'p')</string>
+// CHECK:      <key>message</key>
+// CHECK: <string>Dereference of null pointer (loaded from field 'p')</string>
+// CHECK:     </dict>
+// CHECK:    </array>
+// CHECK:    <key>description</key><string>Dereference of null pointer (loaded from field 'p')</string>
+// CHECK:    <key>category</key><string>Logic error</string>
+// CHECK:    <key>type</key><string>Dereference of null pointer</string>
+// CHECK:   <key>location</key>
+// CHECK:   <dict>
+// CHECK:    <key>line</key><integer>38</integer>
+// CHECK:    <key>col</key><integer>3</integer>
+// CHECK:    <key>file</key><integer>0</integer>
+// CHECK:   </dict>
+// CHECK:   </dict>
+// CHECK:   <dict>
+// CHECK:    <key>path</key>
+// CHECK:    <array>
+// CHECK:     <dict>
+// CHECK:      <key>kind</key><string>control</string>
+// CHECK:      <key>edges</key>
+// CHECK:       <array>
+// CHECK:        <dict>
+// CHECK:         <key>start</key>
+// CHECK:          <array>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>43</integer>
+// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>43</integer>
+// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:         <key>end</key>
+// CHECK:          <array>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>43</integer>
+// CHECK:            <key>col</key><integer>7</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>43</integer>
+// CHECK:            <key>col</key><integer>7</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:        </dict>
+// CHECK:       </array>
+// CHECK:     </dict>
+// CHECK:     <dict>
+// CHECK:      <key>kind</key><string>event</string>
+// CHECK:      <key>location</key>
+// CHECK:      <dict>
+// CHECK:       <key>line</key><integer>43</integer>
 // CHECK:       <key>col</key><integer>7</integer>
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
@@ -614,21 +764,21 @@
 // CHECK:      <array>
 // CHECK:        <array>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>28</integer>
+// CHECK:          <key>line</key><integer>43</integer>
 // CHECK:          <key>col</key><integer>7</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>28</integer>
-// CHECK:          <key>col</key><integer>8</integer>
+// CHECK:          <key>line</key><integer>43</integer>
+// CHECK:          <key>col</key><integer>12</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:        </array>
 // CHECK:      </array>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Assuming pointer value is null</string>
+// CHECK:      <string>Assuming 'a' is not equal to 0</string>
 // CHECK:      <key>message</key>
-// CHECK: <string>Assuming pointer value is null</string>
+// CHECK: <string>Assuming 'a' is not equal to 0</string>
 // CHECK:     </dict>
 // CHECK:     <dict>
 // CHECK:      <key>kind</key><string>control</string>
@@ -638,26 +788,26 @@
 // CHECK:         <key>start</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>28</integer>
+// CHECK:            <key>line</key><integer>43</integer>
 // CHECK:            <key>col</key><integer>7</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>28</integer>
-// CHECK:            <key>col</key><integer>8</integer>
+// CHECK:            <key>line</key><integer>43</integer>
+// CHECK:            <key>col</key><integer>7</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:          </array>
 // CHECK:         <key>end</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>29</integer>
-// CHECK:            <key>col</key><integer>5</integer>
+// CHECK:            <key>line</key><integer>46</integer>
+// CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>29</integer>
-// CHECK:            <key>col</key><integer>5</integer>
+// CHECK:            <key>line</key><integer>46</integer>
+// CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:          </array>
@@ -672,26 +822,26 @@
 // CHECK:         <key>start</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>29</integer>
-// CHECK:            <key>col</key><integer>5</integer>
+// CHECK:            <key>line</key><integer>46</integer>
+// CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>29</integer>
-// CHECK:            <key>col</key><integer>5</integer>
+// CHECK:            <key>line</key><integer>46</integer>
+// CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:          </array>
 // CHECK:         <key>end</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>30</integer>
-// CHECK:            <key>col</key><integer>5</integer>
+// CHECK:            <key>line</key><integer>46</integer>
+// CHECK:            <key>col</key><integer>7</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>30</integer>
-// CHECK:            <key>col</key><integer>6</integer>
+// CHECK:            <key>line</key><integer>46</integer>
+// CHECK:            <key>col</key><integer>7</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:          </array>
@@ -702,21 +852,117 @@
 // CHECK:      <key>kind</key><string>event</string>
 // CHECK:      <key>location</key>
 // CHECK:      <dict>
-// CHECK:       <key>line</key><integer>30</integer>
-// CHECK:       <key>col</key><integer>5</integer>
+// CHECK:       <key>line</key><integer>46</integer>
+// CHECK:       <key>col</key><integer>7</integer>
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
 // CHECK:      <key>ranges</key>
 // CHECK:      <array>
 // CHECK:        <array>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>30</integer>
-// CHECK:          <key>col</key><integer>6</integer>
+// CHECK:          <key>line</key><integer>46</integer>
+// CHECK:          <key>col</key><integer>7</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>30</integer>
-// CHECK:          <key>col</key><integer>6</integer>
+// CHECK:          <key>line</key><integer>46</integer>
+// CHECK:          <key>col</key><integer>12</integer>
+// CHECK:          <key>file</key><integer>0</integer>
+// CHECK:         </dict>
+// CHECK:        </array>
+// CHECK:      </array>
+// CHECK:      <key>extended_message</key>
+// CHECK:      <string>Assuming 'b' is equal to 0</string>
+// CHECK:      <key>message</key>
+// CHECK: <string>Assuming 'b' is equal to 0</string>
+// CHECK:     </dict>
+// CHECK:     <dict>
+// CHECK:      <key>kind</key><string>control</string>
+// CHECK:      <key>edges</key>
+// CHECK:       <array>
+// CHECK:        <dict>
+// CHECK:         <key>start</key>
+// CHECK:          <array>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>46</integer>
+// CHECK:            <key>col</key><integer>7</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>46</integer>
+// CHECK:            <key>col</key><integer>7</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:         <key>end</key>
+// CHECK:          <array>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>49</integer>
+// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>49</integer>
+// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:        </dict>
+// CHECK:       </array>
+// CHECK:     </dict>
+// CHECK:     <dict>
+// CHECK:      <key>kind</key><string>control</string>
+// CHECK:      <key>edges</key>
+// CHECK:       <array>
+// CHECK:        <dict>
+// CHECK:         <key>start</key>
+// CHECK:          <array>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>49</integer>
+// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>49</integer>
+// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:         <key>end</key>
+// CHECK:          <array>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>50</integer>
+// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>50</integer>
+// CHECK:            <key>col</key><integer>4</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:        </dict>
+// CHECK:       </array>
+// CHECK:     </dict>
+// CHECK:     <dict>
+// CHECK:      <key>kind</key><string>event</string>
+// CHECK:      <key>location</key>
+// CHECK:      <dict>
+// CHECK:       <key>line</key><integer>50</integer>
+// CHECK:       <key>col</key><integer>3</integer>
+// CHECK:       <key>file</key><integer>0</integer>
+// CHECK:      </dict>
+// CHECK:      <key>ranges</key>
+// CHECK:      <array>
+// CHECK:        <array>
+// CHECK:         <dict>
+// CHECK:          <key>line</key><integer>50</integer>
+// CHECK:          <key>col</key><integer>4</integer>
+// CHECK:          <key>file</key><integer>0</integer>
+// CHECK:         </dict>
+// CHECK:         <dict>
+// CHECK:          <key>line</key><integer>50</integer>
+// CHECK:          <key>col</key><integer>4</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:        </array>
@@ -732,8 +978,8 @@
 // CHECK:    <key>type</key><string>Dereference of null pointer</string>
 // CHECK:   <key>location</key>
 // CHECK:   <dict>
-// CHECK:    <key>line</key><integer>30</integer>
-// CHECK:    <key>col</key><integer>5</integer>
+// CHECK:    <key>line</key><integer>50</integer>
+// CHECK:    <key>col</key><integer>3</integer>
 // CHECK:    <key>file</key><integer>0</integer>
 // CHECK:   </dict>
 // CHECK:   </dict>
@@ -748,26 +994,26 @@
 // CHECK:         <key>start</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
+// CHECK:            <key>line</key><integer>55</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
-// CHECK:            <key>col</key><integer>8</integer>
+// CHECK:            <key>line</key><integer>55</integer>
+// CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:          </array>
 // CHECK:         <key>end</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
-// CHECK:            <key>col</key><integer>10</integer>
+// CHECK:            <key>line</key><integer>56</integer>
+// CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
-// CHECK:            <key>col</key><integer>10</integer>
+// CHECK:            <key>line</key><integer>56</integer>
+// CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:          </array>
@@ -782,26 +1028,122 @@
 // CHECK:         <key>start</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
-// CHECK:            <key>col</key><integer>10</integer>
+// CHECK:            <key>line</key><integer>56</integer>
+// CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
-// CHECK:            <key>col</key><integer>10</integer>
+// CHECK:            <key>line</key><integer>56</integer>
+// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:         <key>end</key>
+// CHECK:          <array>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>56</integer>
+// CHECK:            <key>col</key><integer>7</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>56</integer>
+// CHECK:            <key>col</key><integer>7</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:        </dict>
+// CHECK:       </array>
+// CHECK:     </dict>
+// CHECK:     <dict>
+// CHECK:      <key>kind</key><string>event</string>
+// CHECK:      <key>location</key>
+// CHECK:      <dict>
+// CHECK:       <key>line</key><integer>56</integer>
+// CHECK:       <key>col</key><integer>7</integer>
+// CHECK:       <key>file</key><integer>0</integer>
+// CHECK:      </dict>
+// CHECK:      <key>ranges</key>
+// CHECK:      <array>
+// CHECK:        <array>
+// CHECK:         <dict>
+// CHECK:          <key>line</key><integer>56</integer>
+// CHECK:          <key>col</key><integer>7</integer>
+// CHECK:          <key>file</key><integer>0</integer>
+// CHECK:         </dict>
+// CHECK:         <dict>
+// CHECK:          <key>line</key><integer>56</integer>
+// CHECK:          <key>col</key><integer>7</integer>
+// CHECK:          <key>file</key><integer>0</integer>
+// CHECK:         </dict>
+// CHECK:        </array>
+// CHECK:      </array>
+// CHECK:      <key>extended_message</key>
+// CHECK:      <string>Assuming 'p' is null</string>
+// CHECK:      <key>message</key>
+// CHECK: <string>Assuming 'p' is null</string>
+// CHECK:     </dict>
+// CHECK:     <dict>
+// CHECK:      <key>kind</key><string>control</string>
+// CHECK:      <key>edges</key>
+// CHECK:       <array>
+// CHECK:        <dict>
+// CHECK:         <key>start</key>
+// CHECK:          <array>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>56</integer>
+// CHECK:            <key>col</key><integer>7</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>56</integer>
+// CHECK:            <key>col</key><integer>7</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:          </array>
 // CHECK:         <key>end</key>
 // CHECK:          <array>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>37</integer>
+// CHECK:            <key>line</key><integer>58</integer>
 // CHECK:            <key>col</key><integer>3</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:           <dict>
-// CHECK:            <key>line</key><integer>37</integer>
-// CHECK:            <key>col</key><integer>8</integer>
+// CHECK:            <key>line</key><integer>58</integer>
+// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:        </dict>
+// CHECK:       </array>
+// CHECK:     </dict>
+// CHECK:     <dict>
+// CHECK:      <key>kind</key><string>control</string>
+// CHECK:      <key>edges</key>
+// CHECK:       <array>
+// CHECK:        <dict>
+// CHECK:         <key>start</key>
+// CHECK:          <array>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>58</integer>
+// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>58</integer>
+// CHECK:            <key>col</key><integer>3</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:          </array>
+// CHECK:         <key>end</key>
+// CHECK:          <array>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>58</integer>
+// CHECK:            <key>col</key><integer>10</integer>
+// CHECK:            <key>file</key><integer>0</integer>
+// CHECK:           </dict>
+// CHECK:           <dict>
+// CHECK:            <key>line</key><integer>58</integer>
+// CHECK:            <key>col</key><integer>11</integer>
 // CHECK:            <key>file</key><integer>0</integer>
 // CHECK:           </dict>
 // CHECK:          </array>
@@ -812,38 +1154,38 @@
 // CHECK:      <key>kind</key><string>event</string>
 // CHECK:      <key>location</key>
 // CHECK:      <dict>
-// CHECK:       <key>line</key><integer>37</integer>
-// CHECK:       <key>col</key><integer>3</integer>
+// CHECK:       <key>line</key><integer>58</integer>
+// CHECK:       <key>col</key><integer>10</integer>
 // CHECK:       <key>file</key><integer>0</integer>
 // CHECK:      </dict>
 // CHECK:      <key>ranges</key>
 // CHECK:      <array>
 // CHECK:        <array>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>37</integer>
-// CHECK:          <key>col</key><integer>3</integer>
+// CHECK:          <key>line</key><integer>58</integer>
+// CHECK:          <key>col</key><integer>11</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:         <dict>
-// CHECK:          <key>line</key><integer>37</integer>
-// CHECK:          <key>col</key><integer>8</integer>
+// CHECK:          <key>line</key><integer>58</integer>
+// CHECK:          <key>col</key><integer>11</integer>
 // CHECK:          <key>file</key><integer>0</integer>
 // CHECK:         </dict>
 // CHECK:        </array>
 // CHECK:      </array>
 // CHECK:      <key>extended_message</key>
-// CHECK:      <string>Dereference of null pointer</string>
+// CHECK:      <string>Dereference of null pointer (loaded from variable 'p')</string>
 // CHECK:      <key>message</key>
-// CHECK: <string>Dereference of null pointer</string>
+// CHECK: <string>Dereference of null pointer (loaded from variable 'p')</string>
 // CHECK:     </dict>
 // CHECK:    </array>
-// CHECK:    <key>description</key><string>Dereference of null pointer</string>
+// CHECK:    <key>description</key><string>Dereference of null pointer (loaded from variable 'p')</string>
 // CHECK:    <key>category</key><string>Logic error</string>
 // CHECK:    <key>type</key><string>Dereference of null pointer</string>
 // CHECK:   <key>location</key>
 // CHECK:   <dict>
-// CHECK:    <key>line</key><integer>37</integer>
-// CHECK:    <key>col</key><integer>3</integer>
+// CHECK:    <key>line</key><integer>58</integer>
+// CHECK:    <key>col</key><integer>10</integer>
 // CHECK:    <key>file</key><integer>0</integer>
 // CHECK:   </dict>
 // CHECK:   </dict>

Modified: cfe/branches/tooling/test/Analysis/retain-release-path-notes.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/retain-release-path-notes.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/retain-release-path-notes.m (original)
+++ cfe/branches/tooling/test/Analysis/retain-release-path-notes.m Fri Jan 20 10:14:22 2012
@@ -110,7 +110,7 @@
 
 CFTypeRef CFGetRuleViolation () {
   CFTypeRef object = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count}}
-  return object; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' is return from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'.  This violates the naming convention rules given the Memory Management Guide for Core Foundation}}
+  return object; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' is returned from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'.  This violates the naming convention rules given in the Memory Management Guide for Core Foundation}}
 }
 
 @implementation Foo (FundamentalMemoryManagementRules)

Modified: cfe/branches/tooling/test/Analysis/retain-release.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/retain-release.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/retain-release.m (original)
+++ cfe/branches/tooling/test/Analysis/retain-release.m Fri Jan 20 10:14:22 2012
@@ -42,6 +42,7 @@
 typedef unsigned long long uint64_t;
 typedef unsigned int UInt32;
 typedef signed long CFIndex;
+typedef CFIndex CFByteOrder;
 typedef struct {
     CFIndex location;
     CFIndex length;
@@ -1604,3 +1605,18 @@
   NSLog(@"%@", otherString);
 }
 
+// RetainCountChecker support for XPC.
+// <rdar://problem/9658496>
+typedef void * xpc_object_t;
+xpc_object_t _CFXPCCreateXPCObjectFromCFObject(CFTypeRef cf);
+void xpc_release(xpc_object_t object);
+
+void rdar9658496() {
+  CFStringRef cf;
+  xpc_object_t xpc;
+  cf = CFStringCreateWithCString( ((CFAllocatorRef)0), "test", kCFStringEncodingUTF8 ); // no-warning
+  xpc = _CFXPCCreateXPCObjectFromCFObject( cf );
+  CFRelease(cf);
+  xpc_release(xpc);
+}
+

Modified: cfe/branches/tooling/test/Analysis/security-syntax-checks-no-emit.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/security-syntax-checks-no-emit.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/security-syntax-checks-no-emit.c (original)
+++ cfe/branches/tooling/test/Analysis/security-syntax-checks-no-emit.c Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-pc-linux-gnu -analyze -analyzer-checker=experimental.security.SecuritySyntactic %s -verify
+// RUN: %clang_cc1 -triple i686-pc-linux-gnu -analyze -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify
 
 // This file complements 'security-syntax-checks.m', but tests that we omit
 // specific checks on platforms where they don't make sense.

Modified: cfe/branches/tooling/test/Analysis/security-syntax-checks.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/security-syntax-checks.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/security-syntax-checks.m (original)
+++ cfe/branches/tooling/test/Analysis/security-syntax-checks.m Fri Jan 20 10:14:22 2012
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=experimental.security.SecuritySyntactic %s -verify
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -DUSE_BUILTINS -analyzer-checker=experimental.security.SecuritySyntactic %s -verify
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -DVARIANT -analyzer-checker=experimental.security.SecuritySyntactic %s -verify
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=experimental.security.SecuritySyntactic %s -verify
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -DUSE_BUILTINS -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -DVARIANT -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify
 
 #ifdef USE_BUILTINS
 # define BUILTIN(f) __builtin_ ## f
@@ -175,3 +175,25 @@
 void test_vfork() {
   vfork(); //expected-warning{{Call to function 'vfork' is insecure as it can lead to denial of service situations in the parent process.}}
 }
+
+//===----------------------------------------------------------------------===
+// mkstemp()
+//===----------------------------------------------------------------------===
+
+char *mkdtemp(char *template);
+int mkstemps(char *template, int suffixlen);
+int mkstemp(char *template);
+char *mktemp(char *template);
+
+void test_mkstemp() {
+  mkstemp("XX"); // expected-warning {{Call to 'mkstemp' should have at least 6 'X's in the format string to be secure (2 'X's seen)}}
+  mkstemp("XXXXXX");
+  mkstemp("XXXXXXX");
+  mkstemps("XXXXXX", 0);
+  mkstemps("XXXXXX", 1); // expected-warning {{5 'X's seen}}
+  mkstemps("XXXXXX", 2); // expected-warning {{Call to 'mkstemps' should have at least 6 'X's in the format string to be secure (4 'X's seen, 2 characters used as a suffix)}}
+  mkdtemp("XX"); // expected-warning {{2 'X's seen}}
+  mkstemp("X"); // expected-warning {{Call to 'mkstemp' should have at least 6 'X's in the format string to be secure (1 'X' seen)}}
+  mkdtemp("XXXXXX");
+}
+

Modified: cfe/branches/tooling/test/Analysis/string.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/string.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/string.c (original)
+++ cfe/branches/tooling/test/Analysis/string.c Fri Jan 20 10:14:22 2012
@@ -133,6 +133,18 @@
     (void)*(char*)0; // expected-warning{{null}}
 }
 
+void strlen_indirect2(char *x) {
+  size_t a = strlen(x);
+  char *p = x;
+  char **p2 = &p;
+  extern void use_string_ptr2(char**);
+  use_string_ptr2(p2);
+
+  size_t c = strlen(x);
+  if (a == 0 && c != 0)
+    (void)*(char*)0; // expected-warning{{null}}
+}
+
 void strlen_liveness(const char *x) {
   if (strlen(x) < 5)
     return;
@@ -285,6 +297,10 @@
   strcpy(x, (char*)&strcpy_fn); // expected-warning{{Argument to string copy function is the address of the function 'strcpy_fn', which is not a null-terminated string}}
 }
 
+void strcpy_fn_const(char *x) {
+  strcpy(x, (const char*)&strcpy_fn); // expected-warning{{Argument to string copy function is the address of the function 'strcpy_fn', which is not a null-terminated string}}
+}
+
 void strcpy_effects(char *x, char *y) {
   char a = x[0];
 

Modified: cfe/branches/tooling/test/Analysis/taint-generic.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/taint-generic.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/taint-generic.c (original)
+++ cfe/branches/tooling/test/Analysis/taint-generic.c Fri Jan 20 10:14:22 2012
@@ -1,8 +1,34 @@
-// RUN: %clang_cc1  -analyze -analyzer-checker=experimental.security.taint,experimental.security.ArrayBoundV2 -verify %s
+// RUN: %clang_cc1  -analyze -analyzer-checker=experimental.security.taint,experimental.security.ArrayBoundV2 -Wno-format-security -verify %s
 
 int scanf(const char *restrict format, ...);
 int getchar(void);
 
+typedef struct _FILE FILE;
+extern FILE *stdin;
+int fscanf(FILE *restrict stream, const char *restrict format, ...);
+int sprintf(char *str, const char *format, ...);
+void setproctitle(const char *fmt, ...);
+typedef __typeof(sizeof(int)) size_t;
+
+// Define string functions. Use builtin for some of them. They all default to
+// the processing in the taint checker.
+#define strcpy(dest, src) \
+  ((__builtin_object_size(dest, 0) != -1ULL) \
+   ? __builtin___strcpy_chk (dest, src, __builtin_object_size(dest, 1)) \
+   : __inline_strcpy_chk(dest, src))
+
+static char *__inline_strcpy_chk (char *dest, const char *src) {
+  return __builtin___strcpy_chk(dest, src, __builtin_object_size(dest, 1));
+}
+char *stpcpy(char *restrict s1, const char *restrict s2);
+char *strncpy( char * destination, const char * source, size_t num );
+char *strndup(const char *s, size_t n);
+char *strncat(char *restrict s1, const char *restrict s2, size_t n);
+
+void *malloc(size_t);
+void *calloc(size_t nmemb, size_t size);
+void bcopy(void *s1, void *s2, size_t n);
+
 #define BUFSIZE 10
 
 int Buffer[BUFSIZE];
@@ -46,3 +72,102 @@
   int m = getchar();
   Buffer[m] = 1;  //expected-warning {{Out of bound memory access }}
 }
+
+void testUncontrolledFormatString(char **p) {
+  char s[80];
+  fscanf(stdin, "%s", s);
+  char buf[128];
+  sprintf(buf,s); // expected-warning {{Uncontrolled Format String}}
+  setproctitle(s, 3); // expected-warning {{Uncontrolled Format String}}
+
+  // Test taint propagation through strcpy and family.
+  char scpy[80];
+  strcpy(scpy, s);
+  sprintf(buf,scpy); // expected-warning {{Uncontrolled Format String}}
+
+  stpcpy(*(++p), s); // this generates __inline.
+  setproctitle(*(p), 3); // expected-warning {{Uncontrolled Format String}}
+
+  char spcpy[80];
+  stpcpy(spcpy, s);
+  setproctitle(spcpy, 3); // expected-warning {{Uncontrolled Format String}}
+
+  char *spcpyret;
+  spcpyret = stpcpy(spcpy, s);
+  setproctitle(spcpyret, 3); // expected-warning {{Uncontrolled Format String}}
+
+  char sncpy[80];
+  strncpy(sncpy, s, 20);
+  setproctitle(sncpy, 3); // expected-warning {{Uncontrolled Format String}}
+
+  char *dup;
+  dup = strndup(s, 20);
+  setproctitle(dup, 3); // expected-warning {{Uncontrolled Format String}}
+
+}
+
+int system(const char *command);
+void testTaintSystemCall() {
+  char buffer[156];
+  char addr[128];
+  scanf("%s", addr);
+  system(addr); // expected-warning {{Tainted data passed to a system call}}
+
+  // Test that spintf transfers taint.
+  sprintf(buffer, "/bin/mail %s < /tmp/email", addr);
+  system(buffer); // expected-warning {{Tainted data passed to a system call}}
+}
+
+void testTaintSystemCall2() {
+  // Test that snpintf transfers taint.
+  char buffern[156];
+  char addr[128];
+  scanf("%s", addr);
+  __builtin_snprintf(buffern, 10, "/bin/mail %s < /tmp/email", addr);
+  system(buffern); // expected-warning {{Tainted data passed to a system call}}
+}
+
+void testTaintSystemCall3() {
+  char buffern2[156];
+  int numt;
+  char addr[128];
+  scanf("%s %d", addr, &numt);
+  __builtin_snprintf(buffern2, numt, "/bin/mail %s < /tmp/email", "abcd");
+  system(buffern2); // expected-warning {{Tainted data passed to a system call}}
+}
+
+void testTaintedBufferSize() {
+  size_t ts;
+  scanf("%zd", &ts);
+
+  int *buf1 = (int*)malloc(ts*sizeof(int)); // expected-warning {{Tainted data is used to specify the buffer size}}
+  char *dst = (char*)calloc(ts, sizeof(char)); //expected-warning {{Tainted data is used to specify the buffer size}}
+  bcopy(buf1, dst, ts); // expected-warning {{Tainted data is used to specify the buffer size}}
+  __builtin_memcpy(dst, buf1, (ts + 4)*sizeof(char)); // expected-warning {{Tainted data is used to specify the buffer size}}
+
+  // If both buffers are trusted, do not issue a warning.
+  char *dst2 = (char*)malloc(ts*sizeof(char)); // expected-warning {{Tainted data is used to specify the buffer size}}
+  strncat(dst2, dst, ts); // no-warning
+}
+
+#define AF_UNIX   1   /* local to host (pipes) */
+#define AF_INET   2   /* internetwork: UDP, TCP, etc. */
+#define AF_LOCAL  AF_UNIX   /* backward compatibility */
+#define SOCK_STREAM 1
+int socket(int, int, int);
+size_t read(int, void *, size_t);
+int  execl(const char *, const char *, ...);
+
+void testSocket() {
+  int sock;
+  char buffer[100];
+
+  sock = socket(AF_INET, SOCK_STREAM, 0);
+  read(sock, buffer, 100);
+  execl(buffer, "filename", 0); // expected-warning {{Tainted data passed to a system call}}
+
+  sock = socket(AF_LOCAL, SOCK_STREAM, 0);
+  read(sock, buffer, 100);
+  execl(buffer, "filename", 0); // no-warning
+}
+

Modified: cfe/branches/tooling/test/Analysis/taint-tester.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/taint-tester.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/taint-tester.c (original)
+++ cfe/branches/tooling/test/Analysis/taint-tester.c Fri Jan 20 10:14:22 2012
@@ -151,6 +151,15 @@
   int jjj = iii;// expected-warning + {{tainted}}
 }
 
+// Test that stdin does not get invalidated by calls.
+void foo();
+void stdinTest4() {
+  int i;
+  fscanf(stdin, "%d", &i);
+  foo();
+  int j = i; // expected-warning + {{tainted}}
+}
+
 // Test propagation functions - the ones that propagate taint from arguments to
 // return value, ptr arguments.
 
@@ -164,15 +173,10 @@
   int d = atoi(s); // expected-warning + {{tainted}}
   int td = d; // expected-warning + {{tainted}}
 
-  // TODO: We shouldn't have to redefine the taint source here.
-  char sl[80];
-  scanf("%s", sl);
-  long l = atol(sl); // expected-warning + {{tainted}}
+  long l = atol(s); // expected-warning + {{tainted}}
   int tl = l; // expected-warning + {{tainted}}
 
-  char sll[80];
-  scanf("%s", sll);
-  long long ll = atoll(sll); // expected-warning + {{tainted}}
+  long long ll = atoll(s); // expected-warning + {{tainted}}
   int tll = ll; // expected-warning + {{tainted}}
 
 }

Modified: cfe/branches/tooling/test/Analysis/temp-obj-dtors-cfg-output.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/temp-obj-dtors-cfg-output.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/temp-obj-dtors-cfg-output.cpp (original)
+++ cfe/branches/tooling/test/Analysis/temp-obj-dtors-cfg-output.cpp Fri Jan 20 10:14:22 2012
@@ -106,671 +106,662 @@
   : a(int(A()) + int(B()))
   , b() {}
 
-// CHECK:  [ B2 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B1 ]
-// CHECK:       1: A()
-// CHECK:       2: [B1.1] (BindTemporary)
-// CHECK:       3: [B1.2].operator int
-// CHECK:       4: [B1.3]()
-// CHECK:       5: [B1.4]
-// CHECK:       6: int([B1.5])
-// CHECK:       7: B()
-// CHECK:       8: [B1.7] (BindTemporary)
-// CHECK:       9: [B1.8].operator int
-// CHECK:      10: [B1.9]()
-// CHECK:      11: [B1.10]
-// CHECK:      12: int([B1.11])
-// CHECK:      13: [B1.6] + [B1.12]
-// CHECK:      14: int a = int(A().operator int()) + int(B().operator int());
-// CHECK:      15: ~B() (Temporary object destructor)
-// CHECK:      16: ~A() (Temporary object destructor)
-// CHECK:      17: A()
-// CHECK:      18: [B1.17] (BindTemporary)
-// CHECK:      19: [B1.18].operator int
-// CHECK:      20: [B1.19]()
-// CHECK:      21: [B1.20]
-// CHECK:      22: int([B1.21])
-// CHECK:      23: B()
-// CHECK:      24: [B1.23] (BindTemporary)
-// CHECK:      25: [B1.24].operator int
-// CHECK:      26: [B1.25]()
-// CHECK:      27: [B1.26]
-// CHECK:      28: int([B1.27])
-// CHECK:      29: [B1.22] + [B1.28]
-// CHECK:      30: foo
-// CHECK:      31: [B1.30]
-// CHECK:      32: [B1.31]([B1.29])
-// CHECK:      33: ~B() (Temporary object destructor)
-// CHECK:      34: ~A() (Temporary object destructor)
-// CHECK:      35: int b;
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B10 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B8
-// CHECK:  [ B1 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: int b;
-// CHECK:     Predecessors (2): B2 B3
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: ~B() (Temporary object destructor)
-// CHECK:     Predecessors (1): B3
-// CHECK:     Successors (1): B1
-// CHECK:  [ B3 ]
-// CHECK:       1: [B4.6] && [B5.5]
-// CHECK:       2: foo
-// CHECK:       3: [B3.2]
-// CHECK:       4: [B3.3]([B3.1])
-// CHECK:       T: [B4.6] && ...
-// CHECK:     Predecessors (2): B5 B4
-// CHECK:     Successors (2): B2 B1
-// CHECK:  [ B4 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: A()
-// CHECK:       3: [B4.2] (BindTemporary)
-// CHECK:       4: [B4.3].operator _Bool
-// CHECK:       5: [B4.4]()
-// CHECK:       6: [B4.5]
-// CHECK:       T: [B4.6] && ...
-// CHECK:     Predecessors (2): B6 B7
-// CHECK:     Successors (2): B5 B3
-// CHECK:  [ B5 ]
-// CHECK:       1: B()
-// CHECK:       2: [B5.1] (BindTemporary)
-// CHECK:       3: [B5.2].operator _Bool
-// CHECK:       4: [B5.3]()
-// CHECK:       5: [B5.4]
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B3
-// CHECK:  [ B6 ]
-// CHECK:       1: ~B() (Temporary object destructor)
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (1): B4
-// CHECK:  [ B7 ]
-// CHECK:       1: [B8.5] && [B9.5]
-// CHECK:       2: bool a = A().operator _Bool() && B().operator _Bool();
-// CHECK:       T: [B8.5] && ...
-// CHECK:     Predecessors (2): B9 B8
-// CHECK:     Successors (2): B6 B4
-// CHECK:  [ B8 ]
-// CHECK:       1: A()
-// CHECK:       2: [B8.1] (BindTemporary)
-// CHECK:       3: [B8.2].operator _Bool
-// CHECK:       4: [B8.3]()
-// CHECK:       5: [B8.4]
-// CHECK:       T: [B8.5] && ...
-// CHECK:     Predecessors (1): B10
-// CHECK:     Successors (2): B9 B7
-// CHECK:  [ B9 ]
-// CHECK:       1: B()
-// CHECK:       2: [B9.1] (BindTemporary)
-// CHECK:       3: [B9.2].operator _Bool
-// CHECK:       4: [B9.3]()
-// CHECK:       5: [B9.4]
-// CHECK:     Predecessors (1): B8
-// CHECK:     Successors (1): B7
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B10 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B8
-// CHECK:  [ B1 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: int b;
-// CHECK:     Predecessors (2): B2 B3
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: ~B() (Temporary object destructor)
-// CHECK:     Predecessors (1): B3
-// CHECK:     Successors (1): B1
-// CHECK:  [ B3 ]
-// CHECK:       1: [B4.6] || [B5.5]
-// CHECK:       2: foo
-// CHECK:       3: [B3.2]
-// CHECK:       4: [B3.3]([B3.1])
-// CHECK:       T: [B4.6] || ...
-// CHECK:     Predecessors (2): B5 B4
-// CHECK:     Successors (2): B1 B2
-// CHECK:  [ B4 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: A()
-// CHECK:       3: [B4.2] (BindTemporary)
-// CHECK:       4: [B4.3].operator _Bool
-// CHECK:       5: [B4.4]()
-// CHECK:       6: [B4.5]
-// CHECK:       T: [B4.6] || ...
-// CHECK:     Predecessors (2): B6 B7
-// CHECK:     Successors (2): B3 B5
-// CHECK:  [ B5 ]
-// CHECK:       1: B()
-// CHECK:       2: [B5.1] (BindTemporary)
-// CHECK:       3: [B5.2].operator _Bool
-// CHECK:       4: [B5.3]()
-// CHECK:       5: [B5.4]
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B3
-// CHECK:  [ B6 ]
-// CHECK:       1: ~B() (Temporary object destructor)
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (1): B4
-// CHECK:  [ B7 ]
-// CHECK:       1: [B8.5] || [B9.5]
-// CHECK:       2: bool a = A().operator _Bool() || B().operator _Bool();
-// CHECK:       T: [B8.5] || ...
-// CHECK:     Predecessors (2): B9 B8
-// CHECK:     Successors (2): B4 B6
-// CHECK:  [ B8 ]
-// CHECK:       1: A()
-// CHECK:       2: [B8.1] (BindTemporary)
-// CHECK:       3: [B8.2].operator _Bool
-// CHECK:       4: [B8.3]()
-// CHECK:       5: [B8.4]
-// CHECK:       T: [B8.5] || ...
-// CHECK:     Predecessors (1): B10
-// CHECK:     Successors (2): B7 B9
-// CHECK:  [ B9 ]
-// CHECK:       1: B()
-// CHECK:       2: [B9.1] (BindTemporary)
-// CHECK:       3: [B9.2].operator _Bool
-// CHECK:       4: [B9.3]()
-// CHECK:       5: [B9.4]
-// CHECK:     Predecessors (1): B8
-// CHECK:     Successors (1): B7
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B11 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B10
-// CHECK:  [ B1 ]
-// CHECK:       1: int b;
-// CHECK:       2: [B7.4].~A() (Implicit destructor)
-// CHECK:     Predecessors (2): B2 B3
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: 0
-// CHECK:       2: foo
-// CHECK:       3: [B2.2]
-// CHECK:       4: [B2.3]([B2.1])
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B3 ]
-// CHECK:       1: 0
-// CHECK:       2: foo
-// CHECK:       3: [B3.2]
-// CHECK:       4: [B3.3]([B3.1])
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B4 ]
-// CHECK:       1: ~B() (Temporary object destructor)
-// CHECK:       2: B()
-// CHECK:       3: [B4.2] (BindTemporary)
-// CHECK:       4: [B4.3].operator _Bool
-// CHECK:       5: [B4.4]()
-// CHECK:       6: [B4.5]
-// CHECK:       7: ~B() (Temporary object destructor)
-// CHECK:       T: if [B4.6]
-// CHECK:     Predecessors (2): B5 B6
-// CHECK:     Successors (2): B3 B2
-// CHECK:  [ B5 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: ~A() (Temporary object destructor)
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (1): B4
-// CHECK:  [ B6 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: ~A() (Temporary object destructor)
-// CHECK:       3: ~A() (Temporary object destructor)
-// CHECK:       4: ~B() (Temporary object destructor)
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (1): B4
-// CHECK:  [ B7 ]
-// CHECK:       1: [B10.5] ? [B8.5] : [B9.13]
-// CHECK:       2: [B7.1]
-// CHECK:       3: [B7.2]
-// CHECK:       4: A a = B().operator _Bool() ? A() : A(B().operator A());
-// CHECK:       T: [B10.5] ? ... : ...
-// CHECK:     Predecessors (2): B8 B9
-// CHECK:     Successors (2): B5 B6
-// CHECK:  [ B8 ]
-// CHECK:       1: A()
-// CHECK:       2: [B8.1] (BindTemporary)
-// CHECK:       3: [B8.2]
-// CHECK:       4: [B8.3]
-// CHECK:       5: [B8.4] (BindTemporary)
-// CHECK:     Predecessors (1): B10
-// CHECK:     Successors (1): B7
-// CHECK:  [ B9 ]
-// CHECK:       1: B()
-// CHECK:       2: [B9.1] (BindTemporary)
-// CHECK:       3: [B9.2].operator A
-// CHECK:       4: [B9.3]()
-// CHECK:       5: [B9.4]
-// CHECK:       6: [B9.5] (BindTemporary)
-// CHECK:       7: [B9.6]
-// CHECK:       8: [B9.7]
-// CHECK:       9: [B9.8] (BindTemporary)
-// CHECK:      10: A([B9.9])
-// CHECK:      11: [B9.10]
-// CHECK:      12: [B9.11]
-// CHECK:      13: [B9.12] (BindTemporary)
-// CHECK:     Predecessors (1): B10
-// CHECK:     Successors (1): B7
-// CHECK:  [ B10 ]
-// CHECK:       1: B()
-// CHECK:       2: [B10.1] (BindTemporary)
-// CHECK:       3: [B10.2].operator _Bool
-// CHECK:       4: [B10.3]()
-// CHECK:       5: [B10.4]
-// CHECK:       T: [B10.5] ? ... : ...
-// CHECK:     Predecessors (1): B11
-// CHECK:     Successors (2): B8 B9
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B14 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B13
-// CHECK:  [ B1 ]
-// CHECK:       1: ~B() (Temporary object destructor)
-// CHECK:       2: int b;
-// CHECK:       3: [B10.4].~A() (Implicit destructor)
-// CHECK:     Predecessors (2): B2 B3
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: ~A() (Temporary object destructor)
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B3 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: ~A() (Temporary object destructor)
-// CHECK:       3: ~A() (Temporary object destructor)
-// CHECK:       4: ~B() (Temporary object destructor)
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B4 ]
-// CHECK:       1: [B7.6] ? [B5.5] : [B6.13]
-// CHECK:       2: [B4.1]
-// CHECK:       3: [B4.2]
-// CHECK:       4: foo
-// CHECK:       5: [B4.4]
-// CHECK:       6: [B4.5]([B4.3])
-// CHECK:       T: [B7.6] ? ... : ...
-// CHECK:     Predecessors (2): B5 B6
-// CHECK:     Successors (2): B2 B3
-// CHECK:  [ B5 ]
-// CHECK:       1: A()
-// CHECK:       2: [B5.1] (BindTemporary)
-// CHECK:       3: [B5.2]
-// CHECK:       4: [B5.3]
-// CHECK:       5: [B5.4] (BindTemporary)
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (1): B4
-// CHECK:  [ B6 ]
-// CHECK:       1: B()
-// CHECK:       2: [B6.1] (BindTemporary)
-// CHECK:       3: [B6.2].operator A
-// CHECK:       4: [B6.3]()
-// CHECK:       5: [B6.4]
-// CHECK:       6: [B6.5] (BindTemporary)
-// CHECK:       7: [B6.6]
-// CHECK:       8: [B6.7]
-// CHECK:       9: [B6.8] (BindTemporary)
-// CHECK:      10: A([B6.9])
-// CHECK:      11: [B6.10]
-// CHECK:      12: [B6.11]
-// CHECK:      13: [B6.12] (BindTemporary)
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (1): B4
-// CHECK:  [ B7 ]
-// CHECK:       1: ~B() (Temporary object destructor)
-// CHECK:       2: B()
-// CHECK:       3: [B7.2] (BindTemporary)
-// CHECK:       4: [B7.3].operator _Bool
-// CHECK:       5: [B7.4]()
-// CHECK:       6: [B7.5]
-// CHECK:       T: [B7.6] ? ... : ...
-// CHECK:     Predecessors (2): B8 B9
-// CHECK:     Successors (2): B5 B6
-// CHECK:  [ B8 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:     Predecessors (1): B10
-// CHECK:     Successors (1): B7
-// CHECK:  [ B9 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: ~A() (Temporary object destructor)
-// CHECK:       3: ~B() (Temporary object destructor)
-// CHECK:     Predecessors (1): B10
-// CHECK:     Successors (1): B7
-// CHECK:  [ B10 ]
-// CHECK:       1: [B13.5] ? [B11.5] : [B12.13]
-// CHECK:       2: [B10.1]
-// CHECK:       3: [B10.2]
-// CHECK:       4: const A &a = B().operator _Bool() ? A() : A(B().operator A());
-// CHECK:       T: [B13.5] ? ... : ...
-// CHECK:     Predecessors (2): B11 B12
-// CHECK:     Successors (2): B8 B9
-// CHECK:  [ B11 ]
-// CHECK:       1: A()
-// CHECK:       2: [B11.1] (BindTemporary)
-// CHECK:       3: [B11.2]
-// CHECK:       4: [B11.3]
-// CHECK:       5: [B11.4] (BindTemporary)
-// CHECK:     Predecessors (1): B13
-// CHECK:     Successors (1): B10
-// CHECK:  [ B12 ]
-// CHECK:       1: B()
-// CHECK:       2: [B12.1] (BindTemporary)
-// CHECK:       3: [B12.2].operator A
-// CHECK:       4: [B12.3]()
-// CHECK:       5: [B12.4]
-// CHECK:       6: [B12.5] (BindTemporary)
-// CHECK:       7: [B12.6]
-// CHECK:       8: [B12.7]
-// CHECK:       9: [B12.8] (BindTemporary)
-// CHECK:      10: A([B12.9])
-// CHECK:      11: [B12.10]
-// CHECK:      12: [B12.11]
-// CHECK:      13: [B12.12] (BindTemporary)
-// CHECK:     Predecessors (1): B13
-// CHECK:     Successors (1): B10
-// CHECK:  [ B13 ]
-// CHECK:       1: B()
-// CHECK:       2: [B13.1] (BindTemporary)
-// CHECK:       3: [B13.2].operator _Bool
-// CHECK:       4: [B13.3]()
-// CHECK:       5: [B13.4]
-// CHECK:       T: [B13.5] ? ... : ...
-// CHECK:     Predecessors (1): B14
-// CHECK:     Successors (2): B11 B12
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B8 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B7
-// CHECK:  [ B1 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: int b;
-// CHECK:       3: [B4.4].~A() (Implicit destructor)
-// CHECK:     Predecessors (2): B2 B3
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B3 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: ~A() (Temporary object destructor)
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B4 ]
-// CHECK:       1: [B7.2] ?: [B6.5]
-// CHECK:       2: [B4.1]
-// CHECK:       3: [B4.2]
-// CHECK:       4: A a = A() ?: A();
-// CHECK:       T: [B7.5] ? ... : ...
-// CHECK:     Predecessors (2): B5 B6
-// CHECK:     Successors (2): B2 B3
-// CHECK:  [ B5 ]
-// CHECK:       1: [B7.2]
-// CHECK:       2: [B5.1]
-// CHECK:       3: [B5.2]
-// CHECK:       4: [B5.3] (BindTemporary)
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (1): B4
-// CHECK:  [ B6 ]
-// CHECK:       1: A()
-// CHECK:       2: [B6.1] (BindTemporary)
-// CHECK:       3: [B6.2]
-// CHECK:       4: [B6.3]
-// CHECK:       5: [B6.4] (BindTemporary)
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (1): B4
-// CHECK:  [ B7 ]
-// CHECK:       1: A()
-// CHECK:       2: [B7.1] (BindTemporary)
-// CHECK:       3: [B7.2].operator _Bool
-// CHECK:       4: [B7.3]()
-// CHECK:       5: [B7.4]
-// CHECK:       T: [B7.5] ? ... : ...
-// CHECK:     Predecessors (1): B8
-// CHECK:     Successors (2): B5 B6
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B13 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B12
-// CHECK:  [ B1 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: int b;
-// CHECK:       3: [B9.4].~A() (Implicit destructor)
-// CHECK:     Predecessors (2): B2 B3
-// CHECK:     Successors (1): B0
-// CHECK:  [ B2 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B3 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: ~A() (Temporary object destructor)
-// CHECK:     Predecessors (1): B4
-// CHECK:     Successors (1): B1
-// CHECK:  [ B4 ]
-// CHECK:       1: [B7.3] ?: [B6.5]
-// CHECK:       2: [B4.1]
-// CHECK:       3: [B4.2]
-// CHECK:       4: foo
-// CHECK:       5: [B4.4]
-// CHECK:       6: [B4.5]([B4.3])
-// CHECK:       T: [B7.6] ? ... : ...
-// CHECK:     Predecessors (2): B5 B6
-// CHECK:     Successors (2): B2 B3
-// CHECK:  [ B5 ]
-// CHECK:       1: [B7.3]
-// CHECK:       2: [B5.1]
-// CHECK:       3: [B5.2]
-// CHECK:       4: [B5.3] (BindTemporary)
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (1): B4
-// CHECK:  [ B6 ]
-// CHECK:       1: A()
-// CHECK:       2: [B6.1] (BindTemporary)
-// CHECK:       3: [B6.2]
-// CHECK:       4: [B6.3]
-// CHECK:       5: [B6.4] (BindTemporary)
-// CHECK:     Predecessors (1): B7
-// CHECK:     Successors (1): B4
-// CHECK:  [ B7 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:       2: A()
-// CHECK:       3: [B7.2] (BindTemporary)
-// CHECK:       4: [B7.3].operator _Bool
-// CHECK:       5: [B7.4]()
-// CHECK:       6: [B7.5]
-// CHECK:       T: [B7.6] ? ... : ...
-// CHECK:     Predecessors (2): B9 B8
-// CHECK:     Successors (2): B5 B6
-// CHECK:  [ B8 ]
-// CHECK:       1: ~A() (Temporary object destructor)
-// CHECK:     Predecessors (1): B9
-// CHECK:     Successors (1): B7
-// CHECK:  [ B9 ]
-// CHECK:       1: [B12.2] ?: [B11.5]
-// CHECK:       2: [B9.1]
-// CHECK:       3: [B9.2]
-// CHECK:       4: const A &a = A() ?: A();
-// CHECK:       T: [B12.5] ? ... : ...
-// CHECK:     Predecessors (2): B10 B11
-// CHECK:     Successors (2): B7 B8
-// CHECK:  [ B10 ]
-// CHECK:       1: [B12.2]
-// CHECK:       2: [B10.1]
-// CHECK:       3: [B10.2]
-// CHECK:       4: [B10.3] (BindTemporary)
-// CHECK:     Predecessors (1): B12
-// CHECK:     Successors (1): B9
-// CHECK:  [ B11 ]
-// CHECK:       1: A()
-// CHECK:       2: [B11.1] (BindTemporary)
-// CHECK:       3: [B11.2]
-// CHECK:       4: [B11.3]
-// CHECK:       5: [B11.4] (BindTemporary)
-// CHECK:     Predecessors (1): B12
-// CHECK:     Successors (1): B9
-// CHECK:  [ B12 ]
-// CHECK:       1: A()
-// CHECK:       2: [B12.1] (BindTemporary)
-// CHECK:       3: [B12.2].operator _Bool
-// CHECK:       4: [B12.3]()
-// CHECK:       5: [B12.4]
-// CHECK:       T: [B12.5] ? ... : ...
-// CHECK:     Predecessors (1): B13
-// CHECK:     Successors (2): B10 B11
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B2 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B1 ]
-// CHECK:       1: A()
-// CHECK:       2: [B1.1] (BindTemporary)
-// CHECK:       3: [B1.2]
-// CHECK:       4: [B1.3]
-// CHECK:       5: A a = A();
-// CHECK:       6: ~A() (Temporary object destructor)
-// CHECK:       7: int b;
-// CHECK:       8: [B1.5].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B2 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B1 ]
-// CHECK:       1: A()
-// CHECK:       2: [B1.1] (BindTemporary)
-// CHECK:       3: [B1.2]
-// CHECK:       4: [B1.3]
-// CHECK:       5: const A &a = A();
-// CHECK:       6: A()
-// CHECK:       7: [B1.6] (BindTemporary)
-// CHECK:       8: [B1.7]
-// CHECK:       9: [B1.8]
-// CHECK:      10: foo
-// CHECK:      11: [B1.10]
-// CHECK:      12: [B1.11]([B1.9])
-// CHECK:      13: ~A() (Temporary object destructor)
-// CHECK:      14: int b;
-// CHECK:      15: [B1.5].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B2 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B1 ]
-// CHECK:       1: A::make
-// CHECK:       2: [B1.1]
-// CHECK:       3: [B1.2]()
-// CHECK:       4: [B1.3] (BindTemporary)
-// CHECK:       5: [B1.4]
-// CHECK:       6: [B1.5]
-// CHECK:       7: A a = A::make();
-// CHECK:       8: ~A() (Temporary object destructor)
-// CHECK:       9: int b;
-// CHECK:      10: [B1.7].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B2 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B1 ]
-// CHECK:       1: A::make
-// CHECK:       2: [B1.1]
-// CHECK:       3: [B1.2]()
-// CHECK:       4: [B1.3] (BindTemporary)
-// CHECK:       5: [B1.4]
-// CHECK:       6: [B1.5]
-// CHECK:       7: const A &a = A::make();
-// CHECK:       8: A::make
-// CHECK:       9: [B1.8]
-// CHECK:      10: [B1.9]()
-// CHECK:      11: [B1.10] (BindTemporary)
-// CHECK:      12: [B1.11]
-// CHECK:      13: [B1.12]
-// CHECK:      14: foo
-// CHECK:      15: [B1.14]
-// CHECK:      16: [B1.15]([B1.13])
-// CHECK:      17: ~A() (Temporary object destructor)
-// CHECK:      18: int b;
-// CHECK:      19: [B1.7].~A() (Implicit destructor)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B2 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B1 ]
-// CHECK:       1: int a;
-// CHECK:       2: A()
-// CHECK:       3: [B1.2] (BindTemporary)
-// CHECK:       4: [B1.3].operator int
-// CHECK:       5: [B1.4]()
-// CHECK:       6: [B1.5]
-// CHECK:       7: a
-// CHECK:       8: [B1.7] = [B1.6]
-// CHECK:       9: ~A() (Temporary object destructor)
-// CHECK:      10: int b;
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
-// CHECK:  [ B2 (ENTRY) ]
-// CHECK:     Predecessors (0):
-// CHECK:     Successors (1): B1
-// CHECK:  [ B1 ]
-// CHECK:       1: A()
-// CHECK:       2: [B1.1] (BindTemporary)
-// CHECK:       3: [B1.2].operator int
-// CHECK:       4: [B1.3]()
-// CHECK:       5: [B1.4]
-// CHECK:       6: int([B1.5])
-// CHECK:       7: B()
-// CHECK:       8: [B1.7] (BindTemporary)
-// CHECK:       9: [B1.8].operator int
-// CHECK:      10: [B1.9]()
-// CHECK:      11: [B1.10]
-// CHECK:      12: int([B1.11])
-// CHECK:      13: [B1.6] + [B1.12]
-// CHECK:      14: a([B1.13]) (Member initializer)
-// CHECK:      15: ~B() (Temporary object destructor)
-// CHECK:      16: ~A() (Temporary object destructor)
-// CHECK:      17: /*implicit*/int()
-// CHECK:      18: b([B1.17]) (Member initializer)
-// CHECK:     Predecessors (1): B2
-// CHECK:     Successors (1): B0
-// CHECK:  [ B0 (EXIT) ]
-// CHECK:     Predecessors (1): B1
-// CHECK:     Successors (0):
+// CHECK:   [B2 (ENTRY)]
+// CHECK:     Succs (1): B1
+
+// CHECK:   [B1]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B1.1] (BindTemporary)
+// CHECK:     3: [B1.2].operator int
+// CHECK:     4: [B1.3]()
+// CHECK:     5: [B1.4] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:     6: int([B1.5]) (CXXFunctionalCastExpr, NoOp, int)
+// CHECK:     7: B() (CXXConstructExpr, class B)
+// CHECK:     8: [B1.7] (BindTemporary)
+// CHECK:     9: [B1.8].operator int
+// CHECK:    10: [B1.9]()
+// CHECK:    11: [B1.10] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:    12: int([B1.11]) (CXXFunctionalCastExpr, NoOp, int)
+// CHECK:    13: [B1.6] + [B1.12]
+// CHECK:    14: int a = int(A().operator int()) + int(B().operator int());
+// CHECK:    15: ~B() (Temporary object destructor)
+// CHECK:    16: ~A() (Temporary object destructor)
+// CHECK:    17: A() (CXXConstructExpr, class A)
+// CHECK:    18: [B1.17] (BindTemporary)
+// CHECK:    19: [B1.18].operator int
+// CHECK:    20: [B1.19]()
+// CHECK:    21: [B1.20] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:    22: int([B1.21]) (CXXFunctionalCastExpr, NoOp, int)
+// CHECK:    23: B() (CXXConstructExpr, class B)
+// CHECK:    24: [B1.23] (BindTemporary)
+// CHECK:    25: [B1.24].operator int
+// CHECK:    26: [B1.25]()
+// CHECK:    27: [B1.26] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:    28: int([B1.27]) (CXXFunctionalCastExpr, NoOp, int)
+// CHECK:    29: [B1.22] + [B1.28]
+// CHECK:    30: foo
+// CHECK:    31: [B1.30] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(int))
+// CHECK:    32: [B1.31]([B1.29])
+// CHECK:    33: ~B() (Temporary object destructor)
+// CHECK:    34: ~A() (Temporary object destructor)
+// CHECK:    35: int b;
+// CHECK:     Preds (1): B2
+// CHECK:     Succs (1): B0
+// CHECK:   [B0 (EXIT)]
+// CHECK:     Preds (1): B1
+// CHECK:   [B10 (ENTRY)]
+// CHECK:     Succs (1): B8
+// CHECK:   [B1]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: int b;
+// CHECK:     Preds (2): B2 B3
+// CHECK:     Succs (1): B0
+// CHECK:   [B2]
+// CHECK:     1: ~B() (Temporary object destructor)
+// CHECK:     Preds (1): B3
+// CHECK:     Succs (1): B1
+// CHECK:   [B3]
+// CHECK:     1: [B4.6] && [B5.5]
+// CHECK:     2: foo
+// CHECK:     3: [B3.2] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(_Bool))
+// CHECK:     4: [B3.3]([B3.1])
+// CHECK:     T: [B4.6] && ...
+// CHECK:     Preds (2): B5 B4
+// CHECK:     Succs (2): B2 B1
+// CHECK:   [B4]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: A() (CXXConstructExpr, class A)
+// CHECK:     3: [B4.2] (BindTemporary)
+// CHECK:     4: [B4.3].operator _Bool
+// CHECK:     5: [B4.4]()
+// CHECK:     6: [B4.5] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     T: [B4.6] && ...
+// CHECK:     Preds (2): B6 B7
+// CHECK:     Succs (2): B5 B3
+// CHECK:   [B5]
+// CHECK:     1: B() (CXXConstructExpr, class B)
+// CHECK:     2: [B5.1] (BindTemporary)
+// CHECK:     3: [B5.2].operator _Bool
+// CHECK:     4: [B5.3]()
+// CHECK:     5: [B5.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     Preds (1): B4
+// CHECK:     Succs (1): B3
+// CHECK:   [B6]
+// CHECK:     1: ~B() (Temporary object destructor)
+// CHECK:     Preds (1): B7
+// CHECK:     Succs (1): B4
+// CHECK:   [B7]
+// CHECK:     1: [B8.5] && [B9.5]
+// CHECK:     2: bool a = A().operator _Bool() && B().operator _Bool();
+// CHECK:     T: [B8.5] && ...
+// CHECK:     Preds (2): B9 B8
+// CHECK:     Succs (2): B6 B4
+// CHECK:   [B8]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B8.1] (BindTemporary)
+// CHECK:     3: [B8.2].operator _Bool
+// CHECK:     4: [B8.3]()
+// CHECK:     5: [B8.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     T: [B8.5] && ...
+// CHECK:     Preds (1): B10
+// CHECK:     Succs (2): B9 B7
+// CHECK:   [B9]
+// CHECK:     1: B() (CXXConstructExpr, class B)
+// CHECK:     2: [B9.1] (BindTemporary)
+// CHECK:     3: [B9.2].operator _Bool
+// CHECK:     4: [B9.3]()
+// CHECK:     5: [B9.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     Preds (1): B8
+// CHECK:     Succs (1): B7
+// CHECK:   [B0 (EXIT)]
+// CHECK:     Preds (1): B1
+// CHECK:   [B10 (ENTRY)]
+// CHECK:     Succs (1): B8
+// CHECK:   [B1]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: int b;
+// CHECK:     Preds (2): B2 B3
+// CHECK:     Succs (1): B0
+// CHECK:   [B2]
+// CHECK:     1: ~B() (Temporary object destructor)
+// CHECK:     Preds (1): B3
+// CHECK:     Succs (1): B1
+// CHECK:   [B3]
+// CHECK:     1: [B4.6] || [B5.5]
+// CHECK:     2: foo
+// CHECK:     3: [B3.2] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(_Bool))
+// CHECK:     4: [B3.3]([B3.1])
+// CHECK:     T: [B4.6] || ...
+// CHECK:     Preds (2): B5 B4
+// CHECK:     Succs (2): B1 B2
+// CHECK:   [B4]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: A() (CXXConstructExpr, class A)
+// CHECK:     3: [B4.2] (BindTemporary)
+// CHECK:     4: [B4.3].operator _Bool
+// CHECK:     5: [B4.4]()
+// CHECK:     6: [B4.5] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     T: [B4.6] || ...
+// CHECK:     Preds (2): B6 B7
+// CHECK:     Succs (2): B3 B5
+// CHECK:   [B5]
+// CHECK:     1: B() (CXXConstructExpr, class B)
+// CHECK:     2: [B5.1] (BindTemporary)
+// CHECK:     3: [B5.2].operator _Bool
+// CHECK:     4: [B5.3]()
+// CHECK:     5: [B5.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     Preds (1): B4
+// CHECK:     Succs (1): B3
+// CHECK:   [B6]
+// CHECK:     1: ~B() (Temporary object destructor)
+// CHECK:     Preds (1): B7
+// CHECK:     Succs (1): B4
+// CHECK:   [B7]
+// CHECK:     1: [B8.5] || [B9.5]
+// CHECK:     2: bool a = A().operator _Bool() || B().operator _Bool();
+// CHECK:     T: [B8.5] || ...
+// CHECK:     Preds (2): B9 B8
+// CHECK:     Succs (2): B4 B6
+// CHECK:   [B8]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B8.1] (BindTemporary)
+// CHECK:     3: [B8.2].operator _Bool
+// CHECK:     4: [B8.3]()
+// CHECK:     5: [B8.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     T: [B8.5] || ...
+// CHECK:     Preds (1): B10
+// CHECK:     Succs (2): B7 B9
+// CHECK:   [B9]
+// CHECK:     1: B() (CXXConstructExpr, class B)
+// CHECK:     2: [B9.1] (BindTemporary)
+// CHECK:     3: [B9.2].operator _Bool
+// CHECK:     4: [B9.3]()
+// CHECK:     5: [B9.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     Preds (1): B8
+// CHECK:     Succs (1): B7
+// CHECK:   [B0 (EXIT)]
+// CHECK:     Preds (1): B1
+// CHECK:   [B11 (ENTRY)]
+// CHECK:     Succs (1): B10
+// CHECK:   [B1]
+// CHECK:     1: int b;
+// CHECK:     2: [B7.5].~A() (Implicit destructor)
+// CHECK:     Preds (2): B2 B3
+// CHECK:     Succs (1): B0
+// CHECK:   [B2]
+// CHECK:     1: 0
+// CHECK:     2: foo
+// CHECK:     3: [B2.2] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(int))
+// CHECK:     4: [B2.3]([B2.1])
+// CHECK:     Preds (1): B4
+// CHECK:     Succs (1): B1
+// CHECK:   [B3]
+// CHECK:     1: 0
+// CHECK:     2: foo
+// CHECK:     3: [B3.2] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(int))
+// CHECK:     4: [B3.3]([B3.1])
+// CHECK:     Preds (1): B4
+// CHECK:     Succs (1): B1
+// CHECK:   [B4]
+// CHECK:     1: ~B() (Temporary object destructor)
+// CHECK:     2: B() (CXXConstructExpr, class B)
+// CHECK:     3: [B4.2] (BindTemporary)
+// CHECK:     4: [B4.3].operator _Bool
+// CHECK:     5: [B4.4]()
+// CHECK:     6: [B4.5] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     7: ~B() (Temporary object destructor)
+// CHECK:     T: if [B4.6]
+// CHECK:     Preds (2): B5 B6
+// CHECK:     Succs (2): B3 B2
+// CHECK:   [B5]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: ~A() (Temporary object destructor)
+// CHECK:     Preds (1): B7
+// CHECK:     Succs (1): B4
+// CHECK:   [B6]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: ~A() (Temporary object destructor)
+// CHECK:     3: ~A() (Temporary object destructor)
+// CHECK:     4: ~B() (Temporary object destructor)
+// CHECK:     Preds (1): B7
+// CHECK:     Succs (1): B4
+// CHECK:   [B7]
+// CHECK:     1: [B10.5] ? [B8.6] : [B9.15]
+// CHECK:     2: [B7.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     3: [B7.2]
+// CHECK:     4: [B7.3] (CXXConstructExpr, class A)
+// CHECK:     5: A a = B().operator _Bool() ? A() : A(B().operator A());
+// CHECK:     T: [B10.5] ? ... : ...
+// CHECK:     Preds (2): B8 B9
+// CHECK:     Succs (2): B5 B6
+// CHECK:   [B8]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B8.1] (BindTemporary)
+// CHECK:     3: [B8.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     4: [B8.3]
+// CHECK:     5: [B8.4] (CXXConstructExpr, class A)
+// CHECK:     6: [B8.5] (BindTemporary)
+// CHECK:     Preds (1): B10
+// CHECK:     Succs (1): B7
+// CHECK:   [B9]
+// CHECK:     1: B() (CXXConstructExpr, class B)
+// CHECK:     2: [B9.1] (BindTemporary)
+// CHECK:     3: [B9.2].operator A
+// CHECK:     4: [B9.3]()
+// CHECK:     5: [B9.4] (ImplicitCastExpr, UserDefinedConversion, class A)
+// CHECK:     6: [B9.5] (BindTemporary)
+// CHECK:     7: [B9.6] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     8: [B9.7]
+// CHECK:     9: [B9.8] (CXXConstructExpr, class A)
+// CHECK:    10: [B9.9] (BindTemporary)
+// CHECK:    11: A([B9.10]) (CXXFunctionalCastExpr, ConstructorConversion, class A)
+// CHECK:    12: [B9.11] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    13: [B9.12]
+// CHECK:    14: [B9.13] (CXXConstructExpr, class A)
+// CHECK:    15: [B9.14] (BindTemporary)
+// CHECK:     Preds (1): B10
+// CHECK:     Succs (1): B7
+// CHECK:   [B10]
+// CHECK:     1: B() (CXXConstructExpr, class B)
+// CHECK:     2: [B10.1] (BindTemporary)
+// CHECK:     3: [B10.2].operator _Bool
+// CHECK:     4: [B10.3]()
+// CHECK:     5: [B10.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     T: [B10.5] ? ... : ...
+// CHECK:     Preds (1): B11
+// CHECK:     Succs (2): B8 B9
+// CHECK:   [B0 (EXIT)]
+// CHECK:     Preds (1): B1
+// CHECK:   [B14 (ENTRY)]
+// CHECK:     Succs (1): B13
+// CHECK:   [B1]
+// CHECK:     1: ~B() (Temporary object destructor)
+// CHECK:     2: int b;
+// CHECK:     3: [B10.4].~A() (Implicit destructor)
+// CHECK:     Preds (2): B2 B3
+// CHECK:     Succs (1): B0
+// CHECK:   [B2]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: ~A() (Temporary object destructor)
+// CHECK:     Preds (1): B4
+// CHECK:     Succs (1): B1
+// CHECK:   [B3]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: ~A() (Temporary object destructor)
+// CHECK:     3: ~A() (Temporary object destructor)
+// CHECK:     4: ~B() (Temporary object destructor)
+// CHECK:     Preds (1): B4
+// CHECK:     Succs (1): B1
+// CHECK:   [B4]
+// CHECK:     1: [B7.6] ? [B5.6] : [B6.15]
+// CHECK:     2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     3: [B4.2]
+// CHECK:     4: foo
+// CHECK:     5: [B4.4] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class A &))
+// CHECK:     6: [B4.5]([B4.3])
+// CHECK:     T: [B7.6] ? ... : ...
+// CHECK:     Preds (2): B5 B6
+// CHECK:     Succs (2): B2 B3
+// CHECK:   [B5]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B5.1] (BindTemporary)
+// CHECK:     3: [B5.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     4: [B5.3]
+// CHECK:     5: [B5.4] (CXXConstructExpr, class A)
+// CHECK:     6: [B5.5] (BindTemporary)
+// CHECK:     Preds (1): B7
+// CHECK:     Succs (1): B4
+// CHECK:   [B6]
+// CHECK:     1: B() (CXXConstructExpr, class B)
+// CHECK:     2: [B6.1] (BindTemporary)
+// CHECK:     3: [B6.2].operator A
+// CHECK:     4: [B6.3]()
+// CHECK:     5: [B6.4] (ImplicitCastExpr, UserDefinedConversion, class A)
+// CHECK:     6: [B6.5] (BindTemporary)
+// CHECK:     7: [B6.6] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     8: [B6.7]
+// CHECK:     9: [B6.8] (CXXConstructExpr, class A)
+// CHECK:    10: [B6.9] (BindTemporary)
+// CHECK:    11: A([B6.10]) (CXXFunctionalCastExpr, ConstructorConversion, class A)
+// CHECK:    12: [B6.11] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    13: [B6.12]
+// CHECK:    14: [B6.13] (CXXConstructExpr, class A)
+// CHECK:    15: [B6.14] (BindTemporary)
+// CHECK:     Preds (1): B7
+// CHECK:     Succs (1): B4
+// CHECK:   [B7]
+// CHECK:     1: ~B() (Temporary object destructor)
+// CHECK:     2: B() (CXXConstructExpr, class B)
+// CHECK:     3: [B7.2] (BindTemporary)
+// CHECK:     4: [B7.3].operator _Bool
+// CHECK:     5: [B7.4]()
+// CHECK:     6: [B7.5] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     T: [B7.6] ? ... : ...
+// CHECK:     Preds (2): B8 B9
+// CHECK:     Succs (2): B5 B6
+// CHECK:   [B8]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     Preds (1): B10
+// CHECK:     Succs (1): B7
+// CHECK:   [B9]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: ~A() (Temporary object destructor)
+// CHECK:     3: ~B() (Temporary object destructor)
+// CHECK:     Preds (1): B10
+// CHECK:     Succs (1): B7
+// CHECK:   [B10]
+// CHECK:     1: [B13.5] ? [B11.6] : [B12.15]
+// CHECK:     2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     3: [B10.2]
+// CHECK:     4: const A &a = B().operator _Bool() ? A() : A(B().operator A());
+// CHECK:     T: [B13.5] ? ... : ...
+// CHECK:     Preds (2): B11 B12
+// CHECK:     Succs (2): B8 B9
+// CHECK:   [B11]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B11.1] (BindTemporary)
+// CHECK:     3: [B11.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     4: [B11.3]
+// CHECK:     5: [B11.4] (CXXConstructExpr, class A)
+// CHECK:     6: [B11.5] (BindTemporary)
+// CHECK:     Preds (1): B13
+// CHECK:     Succs (1): B10
+// CHECK:   [B12]
+// CHECK:     1: B() (CXXConstructExpr, class B)
+// CHECK:     2: [B12.1] (BindTemporary)
+// CHECK:     3: [B12.2].operator A
+// CHECK:     4: [B12.3]()
+// CHECK:     5: [B12.4] (ImplicitCastExpr, UserDefinedConversion, class A)
+// CHECK:     6: [B12.5] (BindTemporary)
+// CHECK:     7: [B12.6] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     8: [B12.7]
+// CHECK:     9: [B12.8] (CXXConstructExpr, class A)
+// CHECK:    10: [B12.9] (BindTemporary)
+// CHECK:    11: A([B12.10]) (CXXFunctionalCastExpr, ConstructorConversion, class A)
+// CHECK:    12: [B12.11] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    13: [B12.12]
+// CHECK:    14: [B12.13] (CXXConstructExpr, class A)
+// CHECK:    15: [B12.14] (BindTemporary)
+// CHECK:     Preds (1): B13
+// CHECK:     Succs (1): B10
+// CHECK:   [B13]
+// CHECK:     1: B() (CXXConstructExpr, class B)
+// CHECK:     2: [B13.1] (BindTemporary)
+// CHECK:     3: [B13.2].operator _Bool
+// CHECK:     4: [B13.3]()
+// CHECK:     5: [B13.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     T: [B13.5] ? ... : ...
+// CHECK:     Preds (1): B14
+// CHECK:     Succs (2): B11 B12
+// CHECK:   [B0 (EXIT)]
+// CHECK:     Preds (1): B1
+// CHECK:   [B8 (ENTRY)]
+// CHECK:     Succs (1): B7
+// CHECK:   [B1]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: int b;
+// CHECK:     3: [B4.5].~A() (Implicit destructor)
+// CHECK:     Preds (2): B2 B3
+// CHECK:     Succs (1): B0
+// CHECK:   [B2]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     Preds (1): B4
+// CHECK:     Succs (1): B1
+// CHECK:   [B3]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: ~A() (Temporary object destructor)
+// CHECK:     Preds (1): B4
+// CHECK:     Succs (1): B1
+// CHECK:   [B4]
+// CHECK:     1: [B7.2] ?: [B6.6]
+// CHECK:     2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     3: [B4.2]
+// CHECK:     4: [B4.3] (CXXConstructExpr, class A)
+// CHECK:     5: A a = A() ?: A();
+// CHECK:     T: [B7.5] ? ... : ...
+// CHECK:     Preds (2): B5 B6
+// CHECK:     Succs (2): B2 B3
+// CHECK:   [B5]
+// CHECK:     1: [B7.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     2: [B5.1]
+// CHECK:     3: [B5.2] (CXXConstructExpr, class A)
+// CHECK:     4: [B5.3] (BindTemporary)
+// CHECK:     Preds (1): B7
+// CHECK:     Succs (1): B4
+// CHECK:   [B6]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B6.1] (BindTemporary)
+// CHECK:     3: [B6.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     4: [B6.3]
+// CHECK:     5: [B6.4] (CXXConstructExpr, class A)
+// CHECK:     6: [B6.5] (BindTemporary)
+// CHECK:     Preds (1): B7
+// CHECK:     Succs (1): B4
+// CHECK:   [B7]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B7.1] (BindTemporary)
+// CHECK:     3: [B7.2].operator _Bool
+// CHECK:     4: [B7.3]()
+// CHECK:     5: [B7.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     T: [B7.5] ? ... : ...
+// CHECK:     Preds (1): B8
+// CHECK:     Succs (2): B5 B6
+// CHECK:   [B0 (EXIT)]
+// CHECK:     Preds (1): B1
+// CHECK:   [B13 (ENTRY)]
+// CHECK:     Succs (1): B12
+// CHECK:   [B1]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: int b;
+// CHECK:     3: [B9.4].~A() (Implicit destructor)
+// CHECK:     Preds (2): B2 B3
+// CHECK:     Succs (1): B0
+// CHECK:   [B2]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     Preds (1): B4
+// CHECK:     Succs (1): B1
+// CHECK:   [B3]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: ~A() (Temporary object destructor)
+// CHECK:     Preds (1): B4
+// CHECK:     Succs (1): B1
+// CHECK:   [B4]
+// CHECK:     1: [B7.3] ?: [B6.6]
+// CHECK:     2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     3: [B4.2]
+// CHECK:     4: foo
+// CHECK:     5: [B4.4] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class A &))
+// CHECK:     6: [B4.5]([B4.3])
+// CHECK:     T: [B7.6] ? ... : ...
+// CHECK:     Preds (2): B5 B6
+// CHECK:     Succs (2): B2 B3
+// CHECK:   [B5]
+// CHECK:     1: [B7.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     2: [B5.1]
+// CHECK:     3: [B5.2] (CXXConstructExpr, class A)
+// CHECK:     4: [B5.3] (BindTemporary)
+// CHECK:     Preds (1): B7
+// CHECK:     Succs (1): B4
+// CHECK:   [B6]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B6.1] (BindTemporary)
+// CHECK:     3: [B6.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     4: [B6.3]
+// CHECK:     5: [B6.4] (CXXConstructExpr, class A)
+// CHECK:     6: [B6.5] (BindTemporary)
+// CHECK:     Preds (1): B7
+// CHECK:     Succs (1): B4
+// CHECK:   [B7]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     2: A() (CXXConstructExpr, class A)
+// CHECK:     3: [B7.2] (BindTemporary)
+// CHECK:     4: [B7.3].operator _Bool
+// CHECK:     5: [B7.4]()
+// CHECK:     6: [B7.5] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     T: [B7.6] ? ... : ...
+// CHECK:     Preds (2): B9 B8
+// CHECK:     Succs (2): B5 B6
+// CHECK:   [B8]
+// CHECK:     1: ~A() (Temporary object destructor)
+// CHECK:     Preds (1): B9
+// CHECK:     Succs (1): B7
+// CHECK:   [B9]
+// CHECK:     1: [B12.2] ?: [B11.6]
+// CHECK:     2: [B9.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     3: [B9.2]
+// CHECK:     4: const A &a = A() ?: A();
+// CHECK:     T: [B12.5] ? ... : ...
+// CHECK:     Preds (2): B10 B11
+// CHECK:     Succs (2): B7 B8
+// CHECK:   [B10]
+// CHECK:     1: [B12.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     2: [B10.1]
+// CHECK:     3: [B10.2] (CXXConstructExpr, class A)
+// CHECK:     4: [B10.3] (BindTemporary)
+// CHECK:     Preds (1): B12
+// CHECK:     Succs (1): B9
+// CHECK:   [B11]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B11.1] (BindTemporary)
+// CHECK:     3: [B11.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     4: [B11.3]
+// CHECK:     5: [B11.4] (CXXConstructExpr, class A)
+// CHECK:     6: [B11.5] (BindTemporary)
+// CHECK:     Preds (1): B12
+// CHECK:     Succs (1): B9
+// CHECK:   [B12]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B12.1] (BindTemporary)
+// CHECK:     3: [B12.2].operator _Bool
+// CHECK:     4: [B12.3]()
+// CHECK:     5: [B12.4] (ImplicitCastExpr, UserDefinedConversion, _Bool)
+// CHECK:     T: [B12.5] ? ... : ...
+// CHECK:     Preds (1): B13
+// CHECK:     Succs (2): B10 B11
+// CHECK:   [B0 (EXIT)]
+// CHECK:     Preds (1): B1
+// CHECK:   [B2 (ENTRY)]
+// CHECK:     Succs (1): B1
+// CHECK:   [B1]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B1.1] (BindTemporary)
+// CHECK:     3: [B1.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     4: [B1.3]
+// CHECK:     5: [B1.4] (CXXConstructExpr, class A)
+// CHECK:     6: A a = A();
+// CHECK:     7: ~A() (Temporary object destructor)
+// CHECK:     8: int b;
+// CHECK:     9: [B1.6].~A() (Implicit destructor)
+// CHECK:     Preds (1): B2
+// CHECK:     Succs (1): B0
+// CHECK:   [B0 (EXIT)]
+// CHECK:     Preds (1): B1
+// CHECK:   [B2 (ENTRY)]
+// CHECK:     Succs (1): B1
+// CHECK:   [B1]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B1.1] (BindTemporary)
+// CHECK:     3: [B1.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     4: [B1.3]
+// CHECK:     5: const A &a = A();
+// CHECK:     6: A() (CXXConstructExpr, class A)
+// CHECK:     7: [B1.6] (BindTemporary)
+// CHECK:     8: [B1.7] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     9: [B1.8]
+// CHECK:    10: foo
+// CHECK:    11: [B1.10] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class A &))
+// CHECK:    12: [B1.11]([B1.9])
+// CHECK:    13: ~A() (Temporary object destructor)
+// CHECK:    14: int b;
+// CHECK:    15: [B1.5].~A() (Implicit destructor)
+// CHECK:     Preds (1): B2
+// CHECK:     Succs (1): B0
+// CHECK:   [B0 (EXIT)]
+// CHECK:     Preds (1): B1
+// CHECK:   [B2 (ENTRY)]
+// CHECK:     Succs (1): B1
+// CHECK:   [B1]
+// CHECK:     1: A::make
+// CHECK:     2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class A (*)(void))
+// CHECK:     3: [B1.2]()
+// CHECK:     4: [B1.3] (BindTemporary)
+// CHECK:     5: [B1.4] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     6: [B1.5]
+// CHECK:     7: [B1.6] (CXXConstructExpr, class A)
+// CHECK:     8: A a = A::make();
+// CHECK:     9: ~A() (Temporary object destructor)
+// CHECK:    10: int b;
+// CHECK:    11: [B1.8].~A() (Implicit destructor)
+// CHECK:     Preds (1): B2
+// CHECK:     Succs (1): B0
+// CHECK:   [B0 (EXIT)]
+// CHECK:     Preds (1): B1
+// CHECK:   [B2 (ENTRY)]
+// CHECK:     Succs (1): B1
+// CHECK:   [B1]
+// CHECK:     1: A::make
+// CHECK:     2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class A (*)(void))
+// CHECK:     3: [B1.2]()
+// CHECK:     4: [B1.3] (BindTemporary)
+// CHECK:     5: [B1.4] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:     6: [B1.5]
+// CHECK:     7: const A &a = A::make();
+// CHECK:     8: A::make
+// CHECK:     9: [B1.8] (ImplicitCastExpr, FunctionToPointerDecay, class A (*)(void))
+// CHECK:    10: [B1.9]()
+// CHECK:    11: [B1.10] (BindTemporary)
+// CHECK:    12: [B1.11] (ImplicitCastExpr, NoOp, const class A)
+// CHECK:    13: [B1.12]
+// CHECK:    14: foo
+// CHECK:    15: [B1.14] (ImplicitCastExpr, FunctionToPointerDecay, void (*)(const class A &))
+// CHECK:    16: [B1.15]([B1.13])
+// CHECK:    17: ~A() (Temporary object destructor)
+// CHECK:    18: int b;
+// CHECK:    19: [B1.7].~A() (Implicit destructor)
+// CHECK:     Preds (1): B2
+// CHECK:     Succs (1): B0
+// CHECK:   [B0 (EXIT)]
+// CHECK:     Preds (1): B1
+// CHECK:   [B2 (ENTRY)]
+// CHECK:     Succs (1): B1
+// CHECK:   [B1]
+// CHECK:     1: int a;
+// CHECK:     2: A() (CXXConstructExpr, class A)
+// CHECK:     3: [B1.2] (BindTemporary)
+// CHECK:     4: [B1.3].operator int
+// CHECK:     5: [B1.4]()
+// CHECK:     6: [B1.5] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:     7: a
+// CHECK:     8: [B1.7] = [B1.6]
+// CHECK:     9: ~A() (Temporary object destructor)
+// CHECK:    10: int b;
+// CHECK:     Preds (1): B2
+// CHECK:     Succs (1): B0
+// CHECK:   [B0 (EXIT)]
+// CHECK:     Preds (1): B1
+// CHECK:   [B2 (ENTRY)]
+// CHECK:     Succs (1): B1
+// CHECK:   [B1]
+// CHECK:     1: A() (CXXConstructExpr, class A)
+// CHECK:     2: [B1.1] (BindTemporary)
+// CHECK:     3: [B1.2].operator int
+// CHECK:     4: [B1.3]()
+// CHECK:     5: [B1.4] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:     6: int([B1.5]) (CXXFunctionalCastExpr, NoOp, int)
+// CHECK:     7: B() (CXXConstructExpr, class B)
+// CHECK:     8: [B1.7] (BindTemporary)
+// CHECK:     9: [B1.8].operator int
+// CHECK:    10: [B1.9]()
+// CHECK:    11: [B1.10] (ImplicitCastExpr, UserDefinedConversion, int)
+// CHECK:    12: int([B1.11]) (CXXFunctionalCastExpr, NoOp, int)
+// CHECK:    13: [B1.6] + [B1.12]
+// CHECK:    14: a([B1.13]) (Member initializer)
+// CHECK:    15: ~B() (Temporary object destructor)
+// CHECK:    16: ~A() (Temporary object destructor)
+// CHECK:    17: /*implicit*/int()
+// CHECK:    18: b([B1.17]) (Member initializer)
+// CHECK:     Preds (1): B2
+// CHECK:     Succs (1): B0
+// CHECK:   [B0 (EXIT)]
+// CHECK:     Preds (1): B1
 

Modified: cfe/branches/tooling/test/Analysis/uninit-vals-ps-region.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/uninit-vals-ps-region.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/uninit-vals-ps-region.m (original)
+++ cfe/branches/tooling/test/Analysis/uninit-vals-ps-region.m Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-checker=core,deadcode.IdempotentOperations -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-checker=core,experimental.deadcode.IdempotentOperations -verify %s
 
 struct s {
   int data;

Modified: cfe/branches/tooling/test/Analysis/unix-fns.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/unix-fns.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/unix-fns.c (original)
+++ cfe/branches/tooling/test/Analysis/unix-fns.c Fri Jan 20 10:14:22 2012
@@ -9,7 +9,11 @@
 int pthread_once(pthread_once_t *, void (*)(void));
 typedef long unsigned int __darwin_size_t;
 typedef __darwin_size_t size_t;
+void *calloc(size_t, size_t);
 void *malloc(size_t);
+void *realloc(void *, size_t);
+void *alloca(size_t);
+void *valloc(size_t);
 
 typedef void (^dispatch_block_t)(void);
 typedef long dispatch_once_t;
@@ -66,3 +70,69 @@
     foo[i] = 0;
   }
 }
+void test_calloc(void) {
+  char *foo = calloc(0, 42); // expected-warning{{Call to 'calloc' has an allocation size of 0 bytes}}
+  for (unsigned i = 0; i < 100; i++) {
+    foo[i] = 0;
+  }
+}
+void test_calloc2(void) {
+  char *foo = calloc(42, 0); // expected-warning{{Call to 'calloc' has an allocation size of 0 bytes}}
+  for (unsigned i = 0; i < 100; i++) {
+    foo[i] = 0;
+  }
+}
+void test_calloc_nowarn(size_t nmemb, size_t size) {
+  char *foo = calloc(nmemb, size); // no-warning
+  for (unsigned i = 0; i < 100; i++) {
+    foo[i] = 0;
+  }
+}
+void test_realloc(char *ptr) {
+  char *foo = realloc(ptr, 0); // expected-warning{{Call to 'realloc' has an allocation size of 0 bytes}}
+  for (unsigned i = 0; i < 100; i++) {
+    foo[i] = 0;
+  }
+}
+void test_realloc_nowarn(char *ptr, size_t size) {
+  char *foo = realloc(ptr, size); // no-warning
+  for (unsigned i = 0; i < 100; i++) {
+    foo[i] = 0;
+  }
+}
+void test_alloca() {
+  char *foo = alloca(0); // expected-warning{{Call to 'alloca' has an allocation size of 0 bytes}}
+  for(unsigned i = 0; i < 100; i++) {
+    foo[i] = 0; 
+  }
+}
+void test_alloca_nowarn(size_t sz) {
+  char *foo = alloca(sz); // no-warning
+  for(unsigned i = 0; i < 100; i++) {
+    foo[i] = 0;
+  }
+}
+void test_builtin_alloca() {
+  char *foo2 = __builtin_alloca(0); // expected-warning{{Call to 'alloca' has an allocation size of 0 bytes}}
+  for(unsigned i = 0; i < 100; i++) {
+    foo2[i] = 0; 
+  }
+}
+void test_builtin_alloca_nowarn(size_t sz) {
+  char *foo2 = __builtin_alloca(sz); // no-warning
+  for(unsigned i = 0; i < 100; i++) {
+    foo2[i] = 0;
+  }
+}
+void test_valloc() {
+  char *foo = valloc(0); // expected-warning{{Call to 'valloc' has an allocation size of 0 bytes}}
+  for(unsigned i = 0; i < 100; i++) {
+    foo[i] = 0; 
+  }
+}
+void test_valloc_nowarn(size_t sz) {
+  char *foo = valloc(sz); // no-warning
+  for(unsigned i = 0; i < 100; i++) {
+    foo[i] = 0;
+  }
+}

Modified: cfe/branches/tooling/test/CXX/basic/basic.link/p9.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/basic/basic.link/p9.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/basic/basic.link/p9.cpp (original)
+++ cfe/branches/tooling/test/CXX/basic/basic.link/p9.cpp Fri Jan 20 10:14:22 2012
@@ -6,6 +6,5 @@
 // First bullet: two names with external linkage that refer to
 // different kinds of entities.
 void f() {
-  int N(); // expected-error{{redefinition}}
+  int N(); // expected-error{{redefinition}} expected-warning{{interpreted as a function declaration}} expected-note {{replace parentheses with an initializer}}
 }
-

Modified: cfe/branches/tooling/test/CXX/basic/basic.types/p10.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/basic/basic.types/p10.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/basic/basic.types/p10.cpp (original)
+++ cfe/branches/tooling/test/CXX/basic/basic.types/p10.cpp Fri Jan 20 10:14:22 2012
@@ -34,13 +34,12 @@
 struct TrivDtor {
   constexpr TrivDtor();
 };
-// FIXME: when building DefinitionData we look at 'isUserProvided' before it's set up!
-#if 0
+constexpr int f(TrivDtor);
 struct TrivDefaultedDtor {
   constexpr TrivDefaultedDtor();
   ~TrivDefaultedDtor() = default;
 };
-#endif
+constexpr int f(TrivDefaultedDtor);
 
 //  - it is an aggregate type or has at least one constexpr constructor or
 //    constexpr constructor template that is not a copy or move constructor
@@ -100,6 +99,7 @@
   Agg agg[24];
   double d[12];
   TrivDtor td[3];
+  TrivDefaultedDtor tdd[3];
 };
 constexpr int f(ArrGood);
 
@@ -120,9 +120,8 @@
   // Here's one reason why allowing this would be a disaster...
   template<int n> struct Id { int k = n; };
   int f() {
-    // FIXME: correctly check whether the initializer is a constant expression.
-    constexpr MM m = { 0 }; // desired-error {{must be a constant expression}}
+    constexpr MM m = { 0 }; // expected-error {{must be initialized by a constant expression}} expected-note {{non-literal type 'const MutableMembers::MM' cannot be used in a constant expression}} expected-note {{here}}
     ++m.n;
-    return Id<m.n>().k; // expected-error {{not an integral constant expression}}
+    return Id<m.n>().k; // expected-error {{not a constant expression}} expected-note {{initializer of 'm' is not a constant expression}}
   }
 }

Modified: cfe/branches/tooling/test/CXX/class/class.static/class.static.data/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/class/class.static/class.static.data/p3.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/class/class.static/class.static.data/p3.cpp (original)
+++ cfe/branches/tooling/test/CXX/class/class.static/class.static.data/p3.cpp Fri Jan 20 10:14:22 2012
@@ -24,3 +24,22 @@
 const int S::c;
 constexpr int S::d = 0;
 constexpr int S::d2;
+
+template<typename T>
+struct U {
+  static constexpr int a = 0;
+  static constexpr int b; // expected-error {{declaration of constexpr static data member 'b' requires an initializer}}
+  // FIXME: It'd be nice to error on this at template definition time.
+  static constexpr NonLit h = NonLit(); // expected-error 2{{must be initialized by a constant expression}} expected-note 2{{non-literal type}}
+  static constexpr T c = T(); // expected-error {{must be initialized by a constant expression}} expected-note {{non-literal type}}
+  static const T d;
+};
+
+template<typename T> constexpr T U<T>::d = T(); // expected-error {{must be initialized by a constant expression}} expected-note {{non-literal type 'const NonLit'}}
+
+U<int> u1; // expected-note {{here}}
+U<NonLit> u2; // expected-note {{here}}
+
+static_assert(U<int>::a == 0, "");
+
+constexpr int outofline = (U<NonLit>::d, 0); // expected-note {{here}} expected-warning {{unused}}

Modified: cfe/branches/tooling/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p11.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p11.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p11.cpp Fri Jan 20 10:14:22 2012
@@ -12,26 +12,26 @@
 
 namespace test0 {
   namespace ns { void foo(); } // expected-note {{target of using declaration}}
-  int foo(); // expected-note {{conflicting declaration}}
+  int foo(void); // expected-note {{conflicting declaration}}
   using ns::foo; // expected-error {{target of using declaration conflicts with declaration already in scope}}
 }
 
 namespace test1 {
   namespace ns { void foo(); } // expected-note {{target of using declaration}}
   using ns::foo; //expected-note {{using declaration}}
-  int foo(); // expected-error {{declaration conflicts with target of using declaration already in scope}}
+  int foo(void); // expected-error {{declaration conflicts with target of using declaration already in scope}}
 }
 
 namespace test2 {
   namespace ns { void foo(); } // expected-note 2 {{target of using declaration}}
   void test0() {
-    int foo(); // expected-note {{conflicting declaration}}
+    int foo(void); // expected-note {{conflicting declaration}}
     using ns::foo; // expected-error {{target of using declaration conflicts with declaration already in scope}}
   }
 
   void test1() {
     using ns::foo; //expected-note {{using declaration}}
-    int foo(); // expected-error {{declaration conflicts with target of using declaration already in scope}}
+    int foo(void); // expected-error {{declaration conflicts with target of using declaration already in scope}}
   }
 }
 
@@ -39,7 +39,7 @@
   namespace ns { void foo(); } // expected-note 2 {{target of using declaration}}
   class Test0 {
     void test() {
-      int foo(); // expected-note {{conflicting declaration}}
+      int foo(void); // expected-note {{conflicting declaration}}
       using ns::foo; // expected-error {{target of using declaration conflicts with declaration already in scope}}
     }
   };
@@ -47,7 +47,7 @@
   class Test1 {
     void test() {
       using ns::foo; //expected-note {{using declaration}}
-      int foo(); // expected-error {{declaration conflicts with target of using declaration already in scope}}
+      int foo(void); // expected-error {{declaration conflicts with target of using declaration already in scope}}
     }
   };
 }
@@ -56,7 +56,7 @@
   namespace ns { void foo(); } // expected-note 2 {{target of using declaration}}
   template <typename> class Test0 {
     void test() {
-      int foo(); // expected-note {{conflicting declaration}}
+      int foo(void); // expected-note {{conflicting declaration}}
       using ns::foo; // expected-error {{target of using declaration conflicts with declaration already in scope}}
     }
   };
@@ -64,7 +64,7 @@
   template <typename> class Test1 {
     void test() {
       using ns::foo; //expected-note {{using declaration}}
-      int foo(); // expected-error {{declaration conflicts with target of using declaration already in scope}}
+      int foo(void); // expected-error {{declaration conflicts with target of using declaration already in scope}}
     }
   };
 }
@@ -91,4 +91,3 @@
   template class Test0<int>;
   template class Test1<int>; // expected-note {{in instantiation of member function}}
 }
-

Modified: cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp Fri Jan 20 10:14:22 2012
@@ -20,7 +20,7 @@
 // not a definition of an object
 constexpr extern int i2; // expected-error {{constexpr variable declaration must be a definition}}
 // not a literal type
-constexpr notlit nl1; // expected-error {{constexpr variable 'nl1' must be initialized by a constant expression}}
+constexpr notlit nl1; // expected-error {{constexpr variable 'nl1' must be initialized by a constant expression}} expected-note {{non-literal type 'const notlit' cannot be used in a constant expression}}
 // function parameters
 void f2(constexpr int i) {} // expected-error {{function parameter cannot be constexpr}}
 // non-static member
@@ -88,8 +88,7 @@
 template <> char S::g() { return 0; } // expected-error {{no function template matches}}
 template <> double S::g() const { return 0; } // ok
 
-// FIXME: The initializer is a constant expression.
-constexpr int i3 = ft(1); // unexpected-error {{must be initialized by a constant expression}}
+constexpr int i3 = ft(1);
 
 void test() {
   // ignore constexpr when instantiating with non-literal
@@ -98,7 +97,7 @@
 }
 
 // Examples from the standard:
-constexpr int square(int x);
+constexpr int square(int x); // expected-note {{declared here}}
 constexpr int bufsz = 1024;
 
 constexpr struct pixel { // expected-error {{struct cannot be marked constexpr}}
@@ -108,10 +107,10 @@
 };
 
 constexpr pixel::pixel(int a)
-  : x(square(a)), y(square(a))
+  : x(square(a)), y(square(a)) // expected-note {{undefined function 'square' cannot be used in a constant expression}}
   { }
 
-constexpr pixel small(2); // expected-error {{must be initialized by a constant expression}}
+constexpr pixel small(2); // expected-error {{must be initialized by a constant expression}} expected-note {{in call to 'pixel(2)'}}
 
 constexpr int square(int x) {
   return x * x;

Modified: cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp Fri Jan 20 10:14:22 2012
@@ -30,7 +30,7 @@
 
 // The definition of a constexpr function shall satisfy the following
 // constraints:
-struct T : SS { // expected-note {{base class 'SS' of non-literal type}}
+struct T : SS, NonLiteral { // expected-note {{base class 'NonLiteral' of non-literal type}}
   constexpr T(); // expected-error {{non-literal type 'T' cannot have constexpr members}}
 
   //  - it shall not be virtual;
@@ -63,6 +63,10 @@
   constexpr int SelfParam(U);
 };
 
+struct V : virtual U { // expected-note {{here}}
+  constexpr int F(); // expected-error {{constexpr member function not allowed in struct with virtual base class}}
+};
+
 //  or a compound-statememt that contains only
 constexpr int AllowedStmts() {
   //  - null statements

Modified: cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp Fri Jan 20 10:14:22 2012
@@ -30,3 +30,9 @@
     { return x * 2 + 3 * y; }
 
 }
+
+// The constexpr specifier is allowed for static member functions of non-literal types.
+class NonLiteralClass {
+  NonLiteralClass(bool);
+  static constexpr bool isDebugFlag();
+};

Modified: cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp Fri Jan 20 10:14:22 2012
@@ -5,7 +5,7 @@
 constexpr int a = 0;
 extern const int a;
 
-int i;
+int i; // expected-note 2{{here}}
 constexpr int *b = &i;
 extern int *const b;
 
@@ -18,17 +18,17 @@
 // A variable declaration which uses the constexpr specifier shall have an
 // initializer and shall be initialized by a constant expression.
 constexpr int ni1; // expected-error {{default initialization of an object of const type 'const int'}}
-constexpr struct C { C(); } ni2; // expected-error {{constexpr variable 'ni2' must be initialized by a constant expression}}
+constexpr struct C { C(); } ni2; // expected-error {{constexpr variable 'ni2' must be initialized by a constant expression}} expected-note {{non-literal type 'const struct C' cannot be used in a constant expression}}
 constexpr double &ni3; // expected-error {{declaration of reference variable 'ni3' requires an initializer}}
 
-constexpr int nc1 = i; // expected-error {{constexpr variable 'nc1' must be initialized by a constant expression}}
-constexpr C nc2 = C(); // expected-error {{constexpr variable 'nc2' must be initialized by a constant expression}}
-int &f();
-constexpr int &nc3 = f(); // expected-error {{constexpr variable 'nc3' must be initialized by a constant expression}}
-constexpr int nc4(i); // expected-error {{constexpr variable 'nc4' must be initialized by a constant expression}}
-constexpr C nc5((C())); // expected-error {{constexpr variable 'nc5' must be initialized by a constant expression}}
-int &f();
-constexpr int &nc6(f()); // expected-error {{constexpr variable 'nc6' must be initialized by a constant expression}}
+constexpr int nc1 = i; // expected-error {{constexpr variable 'nc1' must be initialized by a constant expression}} expected-note {{read of non-const variable 'i' is not allowed in a constant expression}}
+constexpr C nc2 = C(); // expected-error {{constexpr variable 'nc2' must be initialized by a constant expression}} expected-note {{non-literal type}}
+int &f(); // expected-note {{declared here}}
+constexpr int &nc3 = f(); // expected-error {{constexpr variable 'nc3' must be initialized by a constant expression}} expected-note {{non-constexpr function 'f' cannot be used in a constant expression}}
+constexpr int nc4(i); // expected-error {{constexpr variable 'nc4' must be initialized by a constant expression}} expected-note {{read of non-const variable 'i' is not allowed in a constant expression}}
+constexpr C nc5((C())); // expected-error {{constexpr variable 'nc5' must be initialized by a constant expression}} expected-note {{non-literal type 'const C'}}
+int &f(); // expected-note {{here}}
+constexpr int &nc6(f()); // expected-error {{constexpr variable 'nc6' must be initialized by a constant expression}} expected-note {{non-constexpr function 'f'}}
 
 struct pixel {
   int x, y;

Modified: cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p3.cpp Fri Jan 20 10:14:22 2012
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
-class A {}; // expected-note 3 {{previous use is here}}
+class A {}; // expected-note 4 {{previous use is here}}
+enum E {};
 
 void a1(struct A);
 void a2(class A);
@@ -12,8 +13,8 @@
   friend class A;
   friend union A; // expected-error {{use of 'A' with tag type that does not match previous declaration}}
 
-  friend enum A; // expected-error {{ISO C++ forbids forward references to 'enum' types}} \
-                 // expected-warning {{cannot be a friend}}
+  friend enum A; // expected-error {{use of 'A' with tag type that does not match previous declaration}}
+  friend enum E; // expected-warning {{cannot be a friend}}
 };
 
 template <class T> struct B { // expected-note {{previous use is here}}

Modified: cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1-0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1-0x.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1-0x.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1-0x.cpp Fri Jan 20 10:14:22 2012
@@ -14,56 +14,56 @@
 Aggr ag = { b };
 
 // with no user-provided constructors, ...
-struct NonAggr1a {
-  NonAggr1a(int, int);
+struct NonAggr1a { // expected-note 2 {{candidate constructor}}
+  NonAggr1a(int, int); // expected-note {{candidate constructor}}
   int k;
 };
 // In C++0x, 'user-provided' is only defined for special member functions, so
 // this type is considered to be an aggregate. This is considered to be
 // a language defect.
-NonAggr1a na1a = { 42 }; // expected-error {{non-aggregate type 'NonAggr1a'}}
+NonAggr1a na1a = { 42 }; // expected-error {{no matching constructor for initialization of 'NonAggr1a'}}
 
 struct NonAggr1b {
-  NonAggr1b(const NonAggr1b &);
+  NonAggr1b(const NonAggr1b &); // expected-note {{candidate constructor}}
   int k;
 };
-NonAggr1b na1b = { 42 }; // expected-error {{non-aggregate type 'NonAggr1b'}}
+NonAggr1b na1b = { 42 }; // expected-error {{no matching constructor for initialization of 'NonAggr1b'}}
 
 // no brace-or-equal-initializers for non-static data members, ...
-struct NonAggr2 {
+struct NonAggr2 { // expected-note 3 {{candidate constructor}}
   int m = { 123 };
 };
-NonAggr2 na2 = { 42 }; // expected-error {{non-aggregate type 'NonAggr2'}}
+NonAggr2 na2 = { 42 }; // expected-error {{no matching constructor for initialization of 'NonAggr2'}}
 
 // no private...
-struct NonAggr3 {
+struct NonAggr3 { // expected-note 3 {{candidate constructor}}
 private:
   int n;
 };
-NonAggr3 na3 = { 42 }; // expected-error {{non-aggregate type 'NonAggr3'}}
+NonAggr3 na3 = { 42 }; // expected-error {{no matching constructor for initialization of 'NonAggr3'}}
 
 // or protected non-static data members, ...
-struct NonAggr4 {
+struct NonAggr4 { // expected-note 3 {{candidate constructor}}
 protected:
   int n;
 };
-NonAggr4 na4 = { 42 }; // expected-error {{non-aggregate type 'NonAggr4'}}
+NonAggr4 na4 = { 42 }; // expected-error {{no matching constructor for initialization of 'NonAggr4'}}
 
 // no base classes, ...
-struct NonAggr5 : Aggr {
+struct NonAggr5 : Aggr { // expected-note 3 {{candidate constructor}}
 };
-NonAggr5 na5 = { b }; // expected-error {{non-aggregate type 'NonAggr5'}}
+NonAggr5 na5 = { b }; // expected-error {{no matching constructor for initialization of 'NonAggr5'}}
 template<typename...BaseList>
-struct MaybeAggr5a : BaseList... {};
+struct MaybeAggr5a : BaseList... {}; // expected-note {{explicitly marked deleted}}
 MaybeAggr5a<> ma5a0 = {}; // ok
-MaybeAggr5a<Aggr> ma5a1 = {}; // expected-error {{non-aggregate type 'MaybeAggr5a<Aggr>'}}
+MaybeAggr5a<Aggr> ma5a1 = {}; // expected-error {{call to deleted constructor of 'MaybeAggr5a<Aggr>'}}
 
 // and no virtual functions.
-struct NonAggr6 {
+struct NonAggr6 { // expected-note 3 {{candidate constructor}}
   virtual void f();
   int n;
 };
-NonAggr6 na6 = { 42 }; // expected-error {{non-aggregate type 'NonAggr6'}}
+NonAggr6 na6 = { 42 }; // expected-error {{no matching constructor for initialization of 'NonAggr6'}}
 
 struct DefaultedAggr {
   int n;

Modified: cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-0x.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-0x.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-0x.cpp Fri Jan 20 10:14:22 2012
@@ -31,12 +31,20 @@
   T t;
 };
 
+template<typename T>
+struct Convert {
+  constexpr Convert(T v) : v(v) {}
+  constexpr operator T() const { return v; }
+  T v;
+};
+template<typename T> Convert<T> ConvertVar();
+
 // C++0x [dcl.init.list]p7: A narrowing conversion is an implicit conversion
 //
 // * from a floating-point type to an integer type, or
 
 void float_to_int() {
-  Agg<char> a1 = {1.0F};  // expected-error {{ cannot be narrowed }} expected-note {{override}}
+  Agg<char> a1 = {1.0F};  // expected-error {{type 'float' cannot be narrowed to 'char'}} expected-note {{override}}
   Agg<char> a2 = {1.0};  // expected-error {{ cannot be narrowed }} expected-note {{override}}
   Agg<char> a3 = {1.0L};  // expected-error {{ cannot be narrowed }} expected-note {{override}}
 
@@ -46,6 +54,9 @@
   Agg<char> a4 = {f};  // expected-error {{ cannot be narrowed }} expected-note {{override}}
   Agg<char> a5 = {d};  // expected-error {{ cannot be narrowed }} expected-note {{override}}
   Agg<char> a6 = {ld};  // expected-error {{ cannot be narrowed }} expected-note {{override}}
+
+  Agg<char> ce1 = { Convert<float>(1.0) }; // expected-error {{type 'float' cannot be narrowed to 'char'}} expected-note {{override}}
+  Agg<char> ce2 = { ConvertVar<double>() }; // expected-error {{type 'double' cannot be narrowed to 'char'}} expected-note {{override}}
 }
 
 // * from long double to double or float, or from double to float, except where
@@ -61,7 +72,7 @@
 
   // Variables.
   Agg<float> f1 = {f};  // OK  (no-op)
-  Agg<float> f2 = {d};  // expected-error {{ cannot be narrowed }} expected-note {{override}}
+  Agg<float> f2 = {d};  // expected-error {{non-constant-expression cannot be narrowed from type 'double' to 'float'}} expected-note {{override}}
   Agg<float> f3 = {ld};  // expected-error {{ cannot be narrowed }} expected-note {{override}}
   // Exact constants.
   Agg<float> f4 = {1.0};  // OK  (double constant represented exactly)
@@ -70,7 +81,7 @@
   Agg<float> f6 = {0.1};  // OK (double constant in range but rounded)
   Agg<float> f7 = {0.1L};  // OK (long double constant in range but rounded)
   // Out of range constants.
-  Agg<float> f8 = {1E50};  // expected-error {{ cannot be narrowed }} expected-note {{override}}
+  Agg<float> f8 = {1E50};  // expected-error {{constant expression evaluates to 1.000000e+50 which cannot be narrowed to type 'float'}} expected-note {{override}}
   Agg<float> f9 = {1E50L};  // expected-error {{ cannot be narrowed }} expected-note {{override}}
   // More complex constant expression.
   constexpr long double e40 = 1E40L, e30 = 1E30L, e39 = 1E39L;
@@ -89,6 +100,9 @@
   // More complex constant expression.
   constexpr long double e315 = 1E315L, e305 = 1E305L, e314 = 1E314L;
   Agg<double> d7 = {e315 - 5 * e314 + e305 - 5 * e314};  // OK
+
+  Agg<float> ce1 = { Convert<double>(1e300) }; // expected-error {{constant expression evaluates to 1.000000e+300 which cannot be narrowed to type 'float'}} expected-note {{override}}
+  Agg<double> ce2 = { ConvertVar<long double>() }; // expected-error {{non-constant-expression cannot be narrowed from type 'long double' to 'double'}} expected-note {{override}}
 }
 
 // * from an integer type or unscoped enumeration type to a floating-point type,
@@ -107,6 +121,9 @@
   // Constants.
   Agg<float> f4 = {12345678};  // OK (exactly fits in a float)
   Agg<float> f5 = {123456789};  // expected-error {{ cannot be narrowed }} expected-note {{override}}
+
+  Agg<float> ce1 = { Convert<int>(123456789) }; // expected-error {{constant expression evaluates to 123456789 which cannot be narrowed to type 'float'}} expected-note {{override}}
+  Agg<double> ce2 = { ConvertVar<long long>() }; // expected-error {{non-constant-expression cannot be narrowed from type 'long long' to 'double'}} expected-note {{override}}
 }
 
 // * from an integer type or unscoped enumeration type to an integer type that
@@ -147,6 +164,9 @@
 
   // Conversions from pointers to booleans aren't narrowing conversions.
   Agg<bool> b = {&b1};  // OK
+
+  Agg<short> ce1 = { Convert<int>(100000) }; // expected-error {{constant expression evaluates to 100000 which cannot be narrowed to type 'short'}} expected-note {{override}} expected-warning {{changes value from 100000 to -31072}}
+  Agg<char> ce2 = { ConvertVar<short>() }; // expected-error {{non-constant-expression cannot be narrowed from type 'short' to 'char'}} expected-note {{override}}
 }
 
 // Be sure that type- and value-dependent expressions in templates get the error

Modified: cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.string/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.string/p1.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.string/p1.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.string/p1.cpp Fri Jan 20 10:14:22 2012
@@ -5,3 +5,15 @@
 
 char x2[] = "hello";
 extern char x2[6];
+
+char x3[] = { "hello" };
+extern char x3[6];
+
+wchar_t x4[](L"hello");
+extern wchar_t x4[6];
+
+wchar_t x5[] = L"hello";
+extern wchar_t x5[6];
+
+wchar_t x6[] = { L"hello" };
+extern wchar_t x6[6];

Modified: cfe/branches/tooling/test/CXX/expr/expr.const/p2-0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/expr/expr.const/p2-0x.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/expr/expr.const/p2-0x.cpp (original)
+++ cfe/branches/tooling/test/CXX/expr/expr.const/p2-0x.cpp Fri Jan 20 10:14:22 2012
@@ -33,11 +33,11 @@
   int m : NonConstexpr2().n; // expected-error {{constant expression}} expected-note {{undefined constructor 'NonConstexpr2'}}
 };
 struct NonConstexpr4 {
-  NonConstexpr4();
+  NonConstexpr4(); // expected-note {{declared here}}
   int n;
 };
 struct NonConstexpr5 {
-  int n : NonConstexpr4().n; // expected-error {{constant expression}} expected-note {{non-literal type 'NonConstexpr4' cannot be used in a constant expression}}
+  int n : NonConstexpr4().n; // expected-error {{constant expression}} expected-note {{non-constexpr constructor 'NonConstexpr4' cannot be used in a constant expression}}
 };
 
 // - an invocation of an undefined constexpr function or an undefined
@@ -78,13 +78,13 @@
 namespace NonConstExprCtor {
   struct T {
     constexpr T(const int &r) :
-      r(r) { // expected-note {{reference to temporary cannot be used to initialize a member in a constant expression}}
+      r(r) { // expected-note 2{{reference to temporary cannot be used to initialize a member in a constant expression}}
     }
     const int &r;
   };
   constexpr int n = 0;
   constexpr T t1(n); // ok
-  constexpr T t2(0); // expected-error {{must be initialized by a constant expression}}
+  constexpr T t2(0); // expected-error {{must be initialized by a constant expression}} expected-note {{temporary created here}} expected-note {{in call to 'T(0)'}}
 
   struct S {
     int n : T(4).r; // expected-error {{constant expression}} expected-note {{temporary created here}} expected-note {{in call to 'T(4)'}}
@@ -119,7 +119,7 @@
     switch (n) {
     case (int)4.4e9: // expected-error {{constant expression}} expected-note {{value 4.4E+9 is outside the range of representable values of type 'int'}}
     case (int)(unsigned)(long long)4.4e9: // ok
-    case (float)1e300: // expected-error {{constant expression}} expected-note {{value 1.0E+300 is outside the range of representable values of type 'float'}}
+    case (int)(float)1e300: // expected-error {{constant expression}} expected-note {{value 1.0E+300 is outside the range of representable values of type 'float'}}
     case (int)((float)1e37 / 1e30): // ok
     case (int)(__fp16)65536: // expected-error {{constant expression}} expected-note {{value 65536 is outside the range of representable values of type 'half'}}
       break;
@@ -134,9 +134,31 @@
   constexpr const int &f(const int *q) {
     return q[0]; // expected-note {{dereferenced pointer past the end of subobject of 's' is not a constant expression}}
   }
+  constexpr int n = (f(p), 0); // expected-error {{constant expression}} expected-note {{in call to 'f(&s.m + 1)'}}
   struct T {
-    int n : f(p); // expected-error {{not an integer constant expression}} expected-note {{in call to 'f(&s.m + 1)'}}
+    int n : f(p); // expected-error {{not an integral constant expression}} expected-note {{read of dereferenced one-past-the-end pointer}}
   };
+
+  namespace Ptr {
+    struct A {};
+    struct B : A { int n; };
+    B a[3][3];
+    constexpr B *p = a[0] + 4; // expected-error {{constant expression}} expected-note {{element 4 of array of 3 elements}}
+    B b = {};
+    constexpr A *pa = &b + 1; // expected-error {{constant expression}} expected-note {{base class of pointer past the end}}
+    constexpr B *pb = (B*)((A*)&b + 1); // expected-error {{constant expression}} expected-note {{derived class of pointer past the end}}
+    constexpr const int *pn = &(&b + 1)->n; // expected-error {{constant expression}} expected-note {{field of pointer past the end}}
+    constexpr B *parr = &a[3][0]; // expected-error {{constant expression}} expected-note {{array element of pointer past the end}}
+
+    constexpr A *na = nullptr;
+    constexpr B *nb = nullptr;
+    constexpr A &ra = *nb; // expected-error {{constant expression}} expected-note {{cannot access base class of null pointer}}
+    constexpr B &rb = (B&)*na; // expected-error {{constant expression}} expected-note {{cannot access derived class of null pointer}}
+    static_assert((A*)nb == 0, "");
+    static_assert((B*)na == 0, "");
+    constexpr const int &nf = nb->n; // expected-error {{constant expression}} expected-note {{cannot access field of null pointer}}
+    constexpr const int &np = (*(int(*)[4])nullptr)[2]; // expected-error {{constant expression}} expected-note {{cannot access array element of null pointer}}
+  }
 }
 
 // - a lambda-expression (5.1.2);
@@ -146,26 +168,50 @@
   //int n : []{ return 1; }();
 };
 
-// FIXME:
 // - an lvalue-to-rvalue conversion (4.1) unless it is applied to
-//
-//   - a non-volatile glvalue of integral or enumeration type that refers to a
-//   non-volatile const object with a preceding initialization, initialized with
-//   a constant expression  [Note: a string literal (2.14.5 [lex.string])
-//   corresponds to an array of such objects. -end note], or
-//
-//   - a non-volatile glvalue of literal type that refers to a non-volatile
-//   object defined with constexpr, or that refers to a sub-object of such an
-//   object, or
-//
-//   - a non-volatile glvalue of literal type that refers to a non-volatile
-//   temporary object whose lifetime has not ended, initialized with a constant
-//   expression;
+namespace LValueToRValue {
+  // - a non-volatile glvalue of integral or enumeration type that refers to a
+  //   non-volatile const object with a preceding initialization, initialized
+  //   with a constant expression  [Note: a string literal (2.14.5 [lex.string])
+  //   corresponds to an array of such objects. -end note], or
+  volatile const int vi = 1; // expected-note {{here}}
+  const int ci = 1;
+  volatile const int &vrci = ci;
+  static_assert(vi, ""); // expected-error {{constant expression}} expected-note {{read of volatile-qualified type 'const volatile int'}}
+  static_assert(const_cast<int&>(vi), ""); // expected-error {{constant expression}} expected-note {{read of volatile object 'vi'}}
+  static_assert(vrci, ""); // expected-error {{constant expression}} expected-note {{read of volatile-qualified type}}
+
+  // - a non-volatile glvalue of literal type that refers to a non-volatile
+  //   object defined with constexpr, or that refers to a sub-object of such an
+  //   object, or
+  struct S {
+    constexpr S(int=0) : i(1), v(1) {}
+    constexpr S(const S &s) : i(2), v(2) {}
+    int i;
+    volatile int v;
+  };
+  constexpr S s;
+  constexpr volatile S vs; // expected-note {{here}}
+  constexpr const volatile S &vrs = s;
+  static_assert(s.i, "");
+  static_assert(s.v, ""); // expected-error {{constant expression}} expected-note {{read of volatile-qualified type}}
+  static_assert(vs.i, ""); // expected-error {{constant expression}} expected-note {{read of volatile-qualified type}}
+  static_assert(const_cast<int&>(vs.i), ""); // expected-error {{constant expression}} expected-note {{read of volatile object 'vs'}}
+  static_assert(vrs.i, ""); // expected-error {{constant expression}} expected-note {{read of volatile-qualified type}}
+
+  // - a non-volatile glvalue of literal type that refers to a non-volatile
+  //   temporary object whose lifetime has not ended, initialized with a
+  //   constant expression;
+  constexpr volatile S f() { return S(); }
+  static_assert(f().i, ""); // ok! there's no lvalue-to-rvalue conversion here!
+  static_assert(((volatile const S&&)(S)0).i, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
+}
 
 // FIXME:
 //
-// DR1312: The proposed wording for this defect has issues, so we instead
-// prohibit casts from pointers to cv void (see core-20842 and core-20845).
+// DR1312: The proposed wording for this defect has issues, so we ignore this
+// bullet and instead prohibit casts from pointers to cv void (see core-20842
+// and core-20845).
 //
 // - an lvalue-to-rvalue conversion (4.1 [conv.lval]) that is applied to a
 // glvalue of type cv1 T that refers to an object of type cv2 U, where T and U
@@ -175,34 +221,33 @@
 // - an lvalue-to-rvalue conversion (4.1) that is applied to a glvalue that
 // refers to a non-active member of a union or a subobject thereof;
 
-// FIXME:
 // - an id-expression that refers to a variable or data member of reference type
 //   unless the reference has a preceding initialization, initialized with a
 //   constant expression;
 namespace References {
   const int a = 2;
   int &b = *const_cast<int*>(&a);
-  int c = 10;
+  int c = 10; // expected-note 2 {{here}}
   int &d = c;
   constexpr int e = 42;
   int &f = const_cast<int&>(e);
   extern int &g;
-  constexpr int &h(); // expected-note {{here}}
-  int &i = h();
+  constexpr int &h(); // expected-note 2{{here}}
+  int &i = h(); // expected-note {{here}} expected-note {{undefined function 'h' cannot be used in a constant expression}}
   constexpr int &j() { return b; }
   int &k = j();
 
   struct S {
     int A : a;
     int B : b;
-    int C : c; // expected-error {{constant expression}}
-    int D : d; // expected-error {{constant expression}}
+    int C : c; // expected-error {{constant expression}} expected-note {{read of non-const variable 'c'}}
+    int D : d; // expected-error {{constant expression}} expected-note {{read of non-const variable 'c'}}
     int D2 : &d - &c + 1;
     int E : e / 2;
     int F : f - 11;
     int G : g; // expected-error {{constant expression}}
     int H : h(); // expected-error {{constant expression}} expected-note {{undefined function 'h'}}
-    int I : i; // expected-error {{constant expression}}
+    int I : i; // expected-error {{constant expression}} expected-note {{initializer of 'i' is not a constant expression}}
     int J : j();
     int K : k;
   };
@@ -257,11 +302,10 @@
 namespace TypeId {
   struct S { virtual void f(); };
   constexpr S *p = 0;
-  constexpr const std::type_info &ti1 = typeid(*p); // expected-error {{must be initialized by a constant expression}}
+  constexpr const std::type_info &ti1 = typeid(*p); // expected-error {{must be initialized by a constant expression}} expected-note {{typeid applied to expression of polymorphic type 'TypeId::S'}}
 
-  // FIXME: Implement typeid evaluation.
   struct T {} t;
-  constexpr const std::type_info &ti2 = typeid(t); // unexpected-error {{must be initialized by a constant expression}}
+  constexpr const std::type_info &ti2 = typeid(t);
 }
 
 // - a new-expression (5.3.4);
@@ -354,7 +398,7 @@
 }
 
 // PR9999
-template<bool v>
+template<unsigned int v>
 class bitWidthHolding {
 public:
   static const
@@ -376,3 +420,6 @@
 
 static const bool and_value = and_or<true>::and_value;
 static const bool or_value = and_or<true>::or_value;
+
+static_assert(and_value == false, "");
+static_assert(or_value == true, "");

Modified: cfe/branches/tooling/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp (original)
+++ cfe/branches/tooling/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp Fri Jan 20 10:14:22 2012
@@ -10,3 +10,21 @@
 
 int i = sizeof(S::m); // ok
 int j = sizeof(S::m + 42); // ok
+
+
+struct T {
+  int n;
+  static void f() {
+    int a[n]; // expected-error {{invalid use of member 'n' in static member function}}
+    int b[sizeof n]; // ok
+  }
+};
+
+// Make sure the rule for unevaluated operands works correctly with typeid.
+namespace std {
+  class type_info;
+}
+class Poly { virtual ~Poly(); };
+const std::type_info& k = typeid(S::m);
+const std::type_info& m = typeid(*(Poly*)S::m); // expected-error {{invalid use of nonstatic data member}}
+const std::type_info& n = typeid(*(Poly*)(0*sizeof S::m)); 
\ No newline at end of file

Modified: cfe/branches/tooling/test/CXX/temp/temp.decls/temp.variadic/p4.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/temp/temp.decls/temp.variadic/p4.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/temp/temp.decls/temp.variadic/p4.cpp (original)
+++ cfe/branches/tooling/test/CXX/temp/temp.decls/temp.variadic/p4.cpp Fri Jan 20 10:14:22 2012
@@ -37,7 +37,8 @@
 namespace PR8977 {
   struct A { };
   template<typename T, typename... Args> void f(Args... args) {
-    T t(args...);
+    // An empty expression-list performs value initialization.
+    constexpr T t(args...);
   };
 
   template void f<A>();

Modified: cfe/branches/tooling/test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp (original)
+++ cfe/branches/tooling/test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp Fri Jan 20 10:14:22 2012
@@ -207,3 +207,128 @@
     static void foo();
   };
 }
+
+
+namespace spec_vs_expl_inst {
+
+  // Test all permutations of Specialization,
+  // explicit instantiation Declaration, and explicit instantiation defInition.
+
+  namespace SDI {  // PR11558
+    template <typename STRING_TYPE> class BasicStringPiece;
+    template <> class BasicStringPiece<int> { };
+    extern template class BasicStringPiece<int>;
+    template class BasicStringPiece<int>;
+  }
+
+  namespace SID {
+    template <typename STRING_TYPE> class BasicStringPiece;
+    template <> class BasicStringPiece<int> { };
+    template class BasicStringPiece<int>;  // expected-note {{explicit instantiation definition is here}}
+    extern template class BasicStringPiece<int>;  // expected-error {{explicit instantiation declaration (with 'extern') follows explicit instantiation definition (without 'extern')}}
+  }
+
+  namespace ISD {
+    template <typename STRING_TYPE> class BasicStringPiece;  // expected-note {{template is declared here}}
+    template class BasicStringPiece<int>;  // expected-error {{explicit instantiation of undefined template 'spec_vs_expl_inst::ISD::BasicStringPiece<int>'}}
+    template <> class BasicStringPiece<int> { };
+    extern template class BasicStringPiece<int>;
+  }
+
+  namespace IDS {
+    template <typename STRING_TYPE> class BasicStringPiece;  // expected-note {{template is declared here}}
+    template class BasicStringPiece<int>;  // expected-error {{explicit instantiation of undefined template 'spec_vs_expl_inst::IDS::BasicStringPiece<int>'}}  // expected-note {{explicit instantiation definition is here}}
+    extern template class BasicStringPiece<int>;  // expected-error {{explicit instantiation declaration (with 'extern') follows explicit instantiation definition (without 'extern')}}
+    template <> class BasicStringPiece<int> { };
+  }
+
+  namespace DIS {
+    template <typename STRING_TYPE> class BasicStringPiece;  // expected-note {{template is declared here}}
+    extern template class BasicStringPiece<int>;  // expected-error {{explicit instantiation of undefined template 'spec_vs_expl_inst::DIS::BasicStringPiece<int>'}}
+    template class BasicStringPiece<int>;
+    template <> class BasicStringPiece<int> { };
+  }
+
+  namespace DSI {
+    template <typename STRING_TYPE> class BasicStringPiece;  // expected-note {{template is declared here}}
+    extern template class BasicStringPiece<int>;  // expected-error {{explicit instantiation of undefined template 'spec_vs_expl_inst::DSI::BasicStringPiece<int>'}}
+    template <> class BasicStringPiece<int> { };
+    template class BasicStringPiece<int>;
+  }
+
+  // The same again, with a defined template class.
+
+  namespace SDI_WithDefinedTemplate {
+    template <typename STRING_TYPE> class BasicStringPiece {};
+    template <> class BasicStringPiece<int> { };
+    extern template class BasicStringPiece<int>;
+    template class BasicStringPiece<int>;
+  }
+
+  namespace SID_WithDefinedTemplate {
+    template <typename STRING_TYPE> class BasicStringPiece {};
+    template <> class BasicStringPiece<int> { };
+    template class BasicStringPiece<int>;  // expected-note {{explicit instantiation definition is here}}
+    extern template class BasicStringPiece<int>;  // expected-error {{explicit instantiation declaration (with 'extern') follows explicit instantiation definition (without 'extern')}}
+  }
+
+  namespace ISD_WithDefinedTemplate {
+    template <typename STRING_TYPE> class BasicStringPiece {};
+    template class BasicStringPiece<int>;  // expected-note {{explicit instantiation first required here}}
+    template <> class BasicStringPiece<int> { };  // expected-error {{explicit specialization of 'spec_vs_expl_inst::ISD_WithDefinedTemplate::BasicStringPiece<int>' after instantiation}}
+    extern template class BasicStringPiece<int>;
+  }
+
+  namespace IDS_WithDefinedTemplate {
+    template <typename STRING_TYPE> class BasicStringPiece {};
+    template class BasicStringPiece<int>;  // expected-note {{explicit instantiation definition is here}} expected-note {{previous definition is here}}
+    extern template class BasicStringPiece<int>;  // expected-error {{explicit instantiation declaration (with 'extern') follows explicit instantiation definition (without 'extern')}}
+    template <> class BasicStringPiece<int> { };  // expected-error {{redefinition of 'spec_vs_expl_inst::IDS_WithDefinedTemplate::BasicStringPiece<int>'}}
+  }
+
+  namespace DIS_WithDefinedTemplate {
+    template <typename STRING_TYPE> class BasicStringPiece {};
+    extern template class BasicStringPiece<int>;  // expected-note {{explicit instantiation first required here}}
+    template class BasicStringPiece<int>;
+    template <> class BasicStringPiece<int> { };  // expected-error {{explicit specialization of 'spec_vs_expl_inst::DIS_WithDefinedTemplate::BasicStringPiece<int>' after instantiation}}
+  }
+
+  namespace DSI_WithDefinedTemplate {
+    template <typename STRING_TYPE> class BasicStringPiece {};
+    extern template class BasicStringPiece<int>;  // expected-note {{explicit instantiation first required here}}
+    template <> class BasicStringPiece<int> { };  // expected-error {{explicit specialization of 'spec_vs_expl_inst::DSI_WithDefinedTemplate::BasicStringPiece<int>' after instantiation}}
+    template class BasicStringPiece<int>;
+  }
+
+  // And some more random tests.
+
+  namespace SII_WithDefinedTemplate {
+    template <typename STRING_TYPE> class BasicStringPiece {};
+    template <> class BasicStringPiece<int> { };
+    template class BasicStringPiece<int>;  // expected-note {{previous explicit instantiation is here}}
+    template class BasicStringPiece<int>;  // expected-error {{duplicate explicit instantiation of 'BasicStringPiece<int>'}}
+  }
+
+  namespace SIS {
+    template <typename STRING_TYPE> class BasicStringPiece;
+    template <> class BasicStringPiece<int> { };  // expected-note {{previous definition is here}}
+    template class BasicStringPiece<int>;
+    template <> class BasicStringPiece<int> { };  // expected-error {{redefinition of 'spec_vs_expl_inst::SIS::BasicStringPiece<int>'}}
+  }
+
+  namespace SDS {
+    template <typename STRING_TYPE> class BasicStringPiece;
+    template <> class BasicStringPiece<int> { };  // expected-note {{previous definition is here}}
+    extern template class BasicStringPiece<int>;
+    template <> class BasicStringPiece<int> { };  // expected-error {{redefinition of 'spec_vs_expl_inst::SDS::BasicStringPiece<int>'}}
+  }
+
+  namespace SDIS {
+    template <typename STRING_TYPE> class BasicStringPiece;
+    template <> class BasicStringPiece<int> { };  // expected-note {{previous definition is here}}
+    extern template class BasicStringPiece<int>;
+    template class BasicStringPiece<int>;
+    template <> class BasicStringPiece<int> { };  // expected-error {{redefinition of 'spec_vs_expl_inst::SDIS::BasicStringPiece<int>'}}
+  }
+
+}

Modified: cfe/branches/tooling/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp (original)
+++ cfe/branches/tooling/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp Fri Jan 20 10:14:22 2012
@@ -36,7 +36,8 @@
   template<> void N0::f0(long) { } // expected-error{{not in a namespace enclosing}}
 }
 
-template<> void N0::f0(double) { } // expected-warning{{originally be declared}}
+template<> void N0::f0(double); // expected-warning{{C++11 extension}}
+template<> void N0::f0(double) { }
 
 struct X1 {
   template<typename T> void f(T);
@@ -75,7 +76,7 @@
 
 template<typename T> T N0::X0<T>::member;
 
-template<> struct N0::X0<void> { }; // expected-warning{{originally}}
+template<> struct N0::X0<void> { }; // expected-warning{{C++11 extension}}
 N0::X0<void> test_X0;
 
 namespace N1 {
@@ -124,7 +125,7 @@
   return N0::X0<NonDefaultConstructible>::member;
 }
 
-template<> int N0::X0<int>::member;  // expected-warning{{originally}}
+template<> int N0::X0<int>::member;  // expected-warning{{C++11 extension}}
 
 template<> float N0::X0<float>::member = 3.14f;
 
@@ -152,7 +153,7 @@
 }
 
 template<>
-struct N0::X0<long>::Inner { }; // expected-warning{{originally}}
+struct N0::X0<long>::Inner { }; // expected-warning{{C++11 extension}}
 
 template<>
 struct N0::X0<float>::Inner { };

Modified: cfe/branches/tooling/test/CXX/temp/temp.spec/temp.explicit/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/temp/temp.spec/temp.explicit/p3.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/temp/temp.spec/temp.explicit/p3.cpp (original)
+++ cfe/branches/tooling/test/CXX/temp/temp.spec/temp.explicit/p3.cpp Fri Jan 20 10:14:22 2012
@@ -72,3 +72,10 @@
   template <typename T> int S<T>::i;
   template <typename T> void S<T>::S2::h() {}
 }
+
+namespace PR11599 {
+  template <typename STRING_TYPE> class BasicStringPiece;  // expected-note {{template is declared here}}
+
+  extern template class BasicStringPiece<int>;  // expected-error{{explicit instantiation of undefined template 'PR11599::BasicStringPiece<int>}}
+  template class BasicStringPiece<int>;
+}

Modified: cfe/branches/tooling/test/CodeGen/2007-09-28-PackedUnionMember.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/2007-09-28-PackedUnionMember.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/2007-09-28-PackedUnionMember.c (original)
+++ cfe/branches/tooling/test/CodeGen/2007-09-28-PackedUnionMember.c Fri Jan 20 10:14:22 2012
@@ -27,6 +27,7 @@
 static long hndlr()
 {
   struct H cmd = { 4, 412 };
+  struct H cmd2 = { 4, 412, 0 };
   return 0;
 }
 void foo(void *inWindow) {
@@ -35,4 +36,3 @@
   };
   bork(hndlr, events);
 }
-

Modified: cfe/branches/tooling/test/CodeGen/altivec.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/altivec.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/altivec.c (original)
+++ cfe/branches/tooling/test/CodeGen/altivec.c Fri Jan 20 10:14:22 2012
@@ -5,13 +5,13 @@
 vector int test0 = (vector int)(1);       // CHECK: @test0 = global <4 x i32> <i32 1, i32 1, i32 1, i32 1>
 vector float test1 = (vector float)(1.0); // CHECK: @test1 = global <4 x float> <float 1.000000e+{{0+}}, float 1.000000e+{{0+}}, float 1.000000e+{{0+}}, float 1.000000e+{{0+}}>
 
-// CHECK: @v1 = global <16 x i8> bitcast (<4 x i32> <i32 1, i32 2, i32 3, i32 4> to <16 x i8>)
+// CHECK: @v1 = global <16 x i8> <i8 0, i8 0, i8 0, i8 1, i8 0, i8 0, i8 0, i8 2, i8 0, i8 0, i8 0, i8 3, i8 0, i8 0, i8 0, i8 4>
 vector char v1 = (vector char)((vector int)(1, 2, 3, 4));
-// CHECK: @v2 = global <16 x i8> bitcast (<4 x float> <float 1.000000e+{{0+}}, float 2.000000e+{{0+}}, float 3.000000e+{{0+}}, float 4.000000e+{{0+}}> to <16 x i8>)
+// CHECK: @v2 = global <16 x i8> <i8 63, i8 -128, i8 0, i8 0, i8 64, i8 0, i8 0, i8 0, i8 64, i8 64, i8 0, i8 0, i8 64, i8 -128, i8 0, i8 0>
 vector char v2 = (vector char)((vector float)(1.0f, 2.0f, 3.0f, 4.0f));
-// CHECK: @v3 = global <16 x i8> bitcast (<4 x i32> <i32 97, i32 98, i32 99, i32 100> to <16 x i8>)
+// CHECK: @v3 = global <16 x i8> <i8 0, i8 0, i8 0, i8 97, i8 0, i8 0, i8 0, i8 98, i8 0, i8 0, i8 0, i8 99, i8 0, i8 0, i8 0, i8 100>
 vector char v3 = (vector char)((vector int)('a', 'b', 'c', 'd'));
-// CHECK: @v4 = global <4 x i32> bitcast (<16 x i8> <i8 1, i8 2, i8 3, i8 4, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0> to <4 x i32>)
+// CHECK: @v4 = global <4 x i32> <i32 16909060, i32 0, i32 0, i32 0>
 vector int v4 = (vector char){1, 2, 3, 4};
 
 void test2()

Modified: cfe/branches/tooling/test/CodeGen/builtins-x86.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/builtins-x86.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/builtins-x86.c (original)
+++ cfe/branches/tooling/test/CodeGen/builtins-x86.c Fri Jan 20 10:14:22 2012
@@ -199,12 +199,6 @@
   tmp_V8s = __builtin_ia32_pmulhw128(tmp_V8s, tmp_V8s);
   tmp_V16c = __builtin_ia32_pavgb128(tmp_V16c, tmp_V16c);
   tmp_V8s = __builtin_ia32_pavgw128(tmp_V8s, tmp_V8s);
-  tmp_V16c = __builtin_ia32_pcmpeqb128(tmp_V16c, tmp_V16c);
-  tmp_V8s = __builtin_ia32_pcmpeqw128(tmp_V8s, tmp_V8s);
-  tmp_V4i = __builtin_ia32_pcmpeqd128(tmp_V4i, tmp_V4i);
-  tmp_V16c = __builtin_ia32_pcmpgtb128(tmp_V16c, tmp_V16c);
-  tmp_V8s = __builtin_ia32_pcmpgtw128(tmp_V8s, tmp_V8s);
-  tmp_V4i = __builtin_ia32_pcmpgtd128(tmp_V4i, tmp_V4i);
   tmp_V16c = __builtin_ia32_pmaxub128(tmp_V16c, tmp_V16c);
   tmp_V8s = __builtin_ia32_pmaxsw128(tmp_V8s, tmp_V8s);
   tmp_V16c = __builtin_ia32_pminub128(tmp_V16c, tmp_V16c);

Modified: cfe/branches/tooling/test/CodeGen/cfstring.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/cfstring.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/cfstring.c (original)
+++ cfe/branches/tooling/test/CodeGen/cfstring.c Fri Jan 20 10:14:22 2012
@@ -1,4 +1,14 @@
 // RUN: %clang_cc1 -emit-llvm %s -o %t
+
+// <rdar://problem/10657500>: Check that the backing store of CFStrings are
+// constant with the -fwritable-strings flag.
+//
+// RUN: %clang_cc1 -fwritable-strings -emit-llvm %s -o - | FileCheck %s
+//
+// CHECK: @.str = linker_private unnamed_addr constant [14 x i8] c"Hello, World!\00", align 1
+// CHECK: @.str1 = linker_private unnamed_addr constant [7 x i8] c"yo joe\00", align 1
+// CHECK: @.str3 = linker_private unnamed_addr constant [16 x i8] c"Goodbye, World!\00", align 1
+
 #define CFSTR __builtin___CFStringMakeConstantString
 
 void f() {

Modified: cfe/branches/tooling/test/CodeGen/char-literal.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/char-literal.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/char-literal.c (original)
+++ cfe/branches/tooling/test/CodeGen/char-literal.c Fri Jan 20 10:14:22 2012
@@ -9,11 +9,26 @@
   // CHECK-CPP0X: store i8 97
   char a = 'a';
 
-  // Should pick second character.
+  // Should truncate value (equal to last character).
   // CHECK-C: store i8 98
   // CHECK-CPP0X: store i8 98
   char b = 'ab';
 
+  // Should get concatonated characters
+  // CHECK-C: store i32 24930
+  // CHECK-CPP0X: store i32 24930
+  int b1 = 'ab';
+
+  // Should get concatonated characters
+  // CHECK-C: store i32 808464432
+  // CHECK-CPP0X: store i32 808464432
+  int b2 = '0000';
+
+  // Should get truncated value (last four characters concatonated)
+  // CHECK-C: store i32 1919512167
+  // CHECK-CPP0X: store i32 1919512167
+  int b3 = 'somesillylongstring';
+
   // CHECK-C: store i32 97
   // CHECK-CPP0X: store i32 97
   wchar_t wa = L'a';
@@ -27,26 +42,11 @@
   // CHECK-CPP0X: store i16 97
   char16_t ua = u'a';
 
-  // Should pick second character.
-  // CHECK-CPP0X: store i16 98
-  char16_t ub = u'ab';
-
   // CHECK-CPP0X: store i32 97
   char32_t Ua = U'a';
 
-  // Should pick second character.
-  // CHECK-CPP0X: store i32 98
-  char32_t Ub = U'ab';
 #endif
 
-  // Should pick last character and store its lowest byte.
-  // This does not match gcc, which takes the last character, converts it to
-  // utf8, and then picks the second-lowest byte of that (they probably store
-  // the utf8 in uint16_ts internally and take the lower byte of that).
-  // CHECK-C: store i8 48
-  // CHECK-CPP0X: store i8 48
-  char c = '\u1120\u0220\U00102030';
-
   // CHECK-C: store i32 61451
   // CHECK-CPP0X: store i32 61451
   wchar_t wc = L'\uF00B';
@@ -65,13 +65,6 @@
   wchar_t wd = L'\U0010F00B';
 
 #if __cplusplus >= 201103L
-  // Should take lower word of the 4byte UNC sequence. This does not match
-  // gcc. I don't understand what gcc does (it looks like it converts to utf16,
-  // then takes the second (!) utf16 word, swaps the lower two nibbles, and
-  // stores that?).
-  // CHECK-CPP0X: store i16 -4085
-  char16_t ud = u'\U0010F00B';  // has utf16 encoding dbc8 dcb0
-
   // CHECK-CPP0X: store i32 1110027
   char32_t Ud = U'\U0010F00B';
 #endif
@@ -80,14 +73,4 @@
   // CHECK-C: store i32 1110027
   // CHECK-CPP0X: store i32 1110027
   wchar_t we = L'\u1234\U0010F00B';
-
-#if __cplusplus >= 201103L
-  // Should pick second character.
-  // CHECK-CPP0X: store i16 -4085
-  char16_t ue = u'\u1234\U0010F00B';
-
-  // Should pick second character.
-  // CHECK-CPP0X: store i32 1110027
-  char32_t Ue = U'\u1234\U0010F00B';
-#endif
 }

Modified: cfe/branches/tooling/test/CodeGen/compound-literal.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/compound-literal.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/compound-literal.c (original)
+++ cfe/branches/tooling/test/CodeGen/compound-literal.c Fri Jan 20 10:14:22 2012
@@ -2,8 +2,9 @@
 
 int* a = &(int){1};
 struct s {int a, b, c;} * b = &(struct s) {1, 2, 3};
-// Not working; complex constants are broken
-// _Complex double * x = &(_Complex double){1.0f};
+_Complex double * x = &(_Complex double){1.0f};
+typedef int v4i32 __attribute((vector_size(16)));
+v4i32 *y = &(v4i32){1,2,3,4};
 
 void xxx() {
 int* a = &(int){1};

Modified: cfe/branches/tooling/test/CodeGen/const-init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/const-init.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/const-init.c (original)
+++ cfe/branches/tooling/test/CodeGen/const-init.c Fri Jan 20 10:14:22 2012
@@ -132,3 +132,15 @@
 void g27() { // PR8073
   static void *x = &x;
 }
+
+void g28() {
+  typedef long long v1i64 __attribute((vector_size(8)));
+  typedef short v12i16 __attribute((vector_size(24)));
+  typedef long double v2f80 __attribute((vector_size(24)));
+  // CHECK: @g28.a = internal global <1 x i64> <i64 10>
+  // CHECK: @g28.b = internal global <12 x i16> <i16 0, i16 0, i16 0, i16 -32768, i16 16383, i16 0, i16 0, i16 0, i16 0, i16 -32768, i16 16384, i16 0>
+  // CHECK: @g28.c = internal global <2 x x86_fp80> <x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK40008000000000000000>, align 32
+  static v1i64 a = (v1i64)10LL;
+  static v12i16 b = (v2f80){1,2};
+  static v2f80 c = (v12i16){0,0,0,-32768,16383,0,0,0,0,-32768,16384,0};
+}

Modified: cfe/branches/tooling/test/CodeGen/ext-vector.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/ext-vector.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/ext-vector.c (original)
+++ cfe/branches/tooling/test/CodeGen/ext-vector.c Fri Jan 20 10:14:22 2012
@@ -277,3 +277,12 @@
   d = a == b;
   d = a != b;
 }
+
+// CHECK: @test15
+int4 test15(uint4 V0) {
+  // CHECK: icmp eq <4 x i32>
+  int4 V = !V0;
+  V = V && V;
+  V = V || V;
+  return V;
+}

Modified: cfe/branches/tooling/test/CodeGen/pr9614.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/pr9614.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/pr9614.c (original)
+++ cfe/branches/tooling/test/CodeGen/pr9614.c Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -O1 -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s
 
 extern void foo_alias (void) __asm ("foo");
 inline void foo (void) {
@@ -8,15 +8,22 @@
 inline __attribute__ ((__always_inline__)) void bar (void) {
   return bar_alias ();
 }
+extern char *strrchr_foo (const char *__s, int __c)  __asm ("strrchr");
+extern inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strrchr_foo (const char *__s, int __c)  {
+  return __builtin_strrchr (__s, __c);
+}
 void f(void) {
   foo();
   bar();
+  strrchr_foo("", '.');
 }
 
 // CHECK: define void @f()
 // CHECK: call void @foo()
 // CHECK-NEXT: call void @bar()
+// CHECK-NEXT: call i8* @strrchr(
 // CHECK-NEXT: ret void
 
 // CHECK: declare void @foo()
 // CHECK: declare void @bar()
+// CHECK: declare i8* @strrchr(i8*, i32)

Modified: cfe/branches/tooling/test/CodeGen/string-literal-short-wstring.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/string-literal-short-wstring.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/string-literal-short-wstring.c (original)
+++ cfe/branches/tooling/test/CodeGen/string-literal-short-wstring.c Fri Jan 20 10:14:22 2012
@@ -29,15 +29,4 @@
   // -4085 == 0xf00b
   // CHECK: store i16 -4085
   wchar_t wc = L'\uF00B';
-
-  // Should take lower word of the 4byte UNC sequence. This does not match
-  // gcc. I don't understand what gcc does (it looks like it converts to utf16,
-  // then takes the second (!) utf16 word, swaps the lower two nibbles, and
-  // stores that?).
-  // CHECK: store i16 -4085
-  wchar_t wd = L'\U0010F00B';  // has utf16 encoding dbc8 dcb0
-
-  // Should pick second character. (gcc: -9205)
-  // CHECK: store i16 -4085
-  wchar_t we = L'\u1234\U0010F00B';
 }

Removed: cfe/branches/tooling/test/CodeGen/var-align.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/var-align.c?rev=148544&view=auto
==============================================================================
--- cfe/branches/tooling/test/CodeGen/var-align.c (original)
+++ cfe/branches/tooling/test/CodeGen/var-align.c (removed)
@@ -1,4 +0,0 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - | grep "align 16" | count 2
-
-__attribute((aligned(16))) float a[128];
-union {int a[4]; __attribute((aligned(16))) float b[4];} u;

Modified: cfe/branches/tooling/test/CodeGen/vla.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/vla.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/vla.c (original)
+++ cfe/branches/tooling/test/CodeGen/vla.c Fri Jan 20 10:14:22 2012
@@ -116,9 +116,6 @@
   // CHECK-NEXT: [[T0:%.*]] = load i32* [[N]], align 4
   // CHECK-NEXT: [[DIM1:%.*]] = add i32 [[T0]], 1
 
-  // __typeof.  FIXME: does this really need to be loaded?
-  // CHECK-NEXT: load [6 x i8]** [[P]]
-
   // CHECK-NEXT: [[T0:%.*]] = load [6 x i8]** [[P]], align 4
   // CHECK-NEXT: [[T1:%.*]] = load i32* [[N]], align 4
   // CHECK-NEXT: [[T2:%.*]] = udiv i32 [[T1]], 2

Modified: cfe/branches/tooling/test/CodeGenCXX/blocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/blocks.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/blocks.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/blocks.cpp Fri Jan 20 10:14:22 2012
@@ -203,3 +203,11 @@
   // CHECK-NEXT: call void @_ZN5test63barEv()
   // CHECK-NEXT: ret void
 }
+
+namespace test7 {
+  int f() {
+    static int n;
+    int *const p = &n;
+    return ^{ return *p; }();
+  }
+}

Modified: cfe/branches/tooling/test/CodeGenCXX/const-init.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/const-init.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/const-init.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/const-init.cpp Fri Jan 20 10:14:22 2012
@@ -56,3 +56,23 @@
   const MutableMember MM = { 0 };
   return ++MM.n;
 }
+
+// Make sure we don't try to fold this in the frontend; the backend can't
+// handle it.
+// CHECK: @PR11705 = global i128 0
+__int128_t PR11705 = (__int128_t)&PR11705;
+
+// Make sure we don't try to fold this either.
+// CHECK: @_ZZ23UnfoldableAddrLabelDiffvE1x = internal global i128 0
+void UnfoldableAddrLabelDiff() { static __int128_t x = (long)&&a-(long)&&b; a:b:return;}
+
+// But make sure we do fold this.
+// CHECK: @_ZZ21FoldableAddrLabelDiffvE1x = internal global i64 sub (i64 ptrtoint (i8* blockaddress(@_Z21FoldableAddrLabelDiffv
+void FoldableAddrLabelDiff() { static long x = (long)&&a-(long)&&b; a:b:return;}
+
+// CHECK: @i = constant i32* bitcast (float* @PR9558 to i32*)
+int &i = reinterpret_cast<int&>(PR9558);
+
+int arr[2];
+// CHECK: @pastEnd = constant i32* bitcast (i8* getelementptr (i8* bitcast ([2 x i32]* @arr to i8*), i64 8) to i32*)
+int &pastEnd = arr[2];

Modified: cfe/branches/tooling/test/CodeGenCXX/empty-union.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/empty-union.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/empty-union.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/empty-union.cpp Fri Jan 20 10:14:22 2012
@@ -1,10 +1,7 @@
 // RUN: %clang_cc1 -emit-llvm -o - %s
 
 union sigval { };
+union sigval Test1;
 
-union sigval sigev_value;
-
-int main()
-{
-  return sizeof(sigev_value);
-}
+union NonPODUnion { ~NonPODUnion(); };
+union NonPODUnion Test2;

Modified: cfe/branches/tooling/test/CodeGenCXX/mangle-template.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/mangle-template.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/mangle-template.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/mangle-template.cpp Fri Jan 20 10:14:22 2012
@@ -144,3 +144,12 @@
     f(i, d);
   }
 }
+
+// Report from Jason Merrill on cxx-abi-dev, 2012.01.04.
+namespace test11 {
+  int cmp(char a, char b);
+  template <typename T, int (*cmp)(T, T)> struct A {};
+  template <typename T> void f(A<T,cmp> &) {}
+  template void f<char>(A<char,cmp> &);
+  // CHECK: @_ZN6test111fIcEEvRNS_1AIT_L_ZNS_3cmpEccEEE(
+}

Modified: cfe/branches/tooling/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/mangle.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/mangle.cpp Fri Jan 20 10:14:22 2012
@@ -76,9 +76,6 @@
 // CHECK: define void @_Z1f2S3ILb0EE
 void f(S3<false>) {}
 
-// CHECK: define void @_Z2f22S3ILb1EE
-void f2(S3<100>) {}
-
 struct S;
 
 // CHECK: define void @_Z1fM1SKFvvE

Modified: cfe/branches/tooling/test/CodeGenCXX/pr9965.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/pr9965.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/pr9965.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/pr9965.cpp Fri Jan 20 10:14:22 2012
@@ -3,6 +3,7 @@
 struct X
 {
     X() = default;
+    ~X() {} // not a literal type
 };
 
 X<int> x;

Modified: cfe/branches/tooling/test/CodeGenCXX/typeid.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/typeid.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/typeid.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/typeid.cpp Fri Jan 20 10:14:22 2012
@@ -6,6 +6,27 @@
 // PR7400
 struct A { virtual void f(); };
 
+// CHECK: @_ZN5Test16int_tiE = constant %"class.std::type_info"* bitcast (i8** @_ZTIi to %"class.std::type_info"*), align 8
+const std::type_info &int_ti = typeid(int);
+
+// CHECK: @_ZN5Test14A_tiE = constant %"class.std::type_info"* bitcast (i8** @_ZTIN5Test11AE to %"class.std::type_info"*), align 8
+const std::type_info &A_ti = typeid(const volatile A &);
+
+volatile char c;
+
+// CHECK: @_ZN5Test14c_tiE = constant %"class.std::type_info"* bitcast (i8** @_ZTIc to %"class.std::type_info"*), align 8
+const std::type_info &c_ti = typeid(c);
+
+extern const double &d;
+
+// CHECK: @_ZN5Test14d_tiE = constant %"class.std::type_info"* bitcast (i8** @_ZTId to %"class.std::type_info"*), align 8
+const std::type_info &d_ti = typeid(d);
+
+extern A &a;
+
+// CHECK: @_ZN5Test14a_tiE = global
+const std::type_info &a_ti = typeid(a);
+
 // CHECK: define i8* @_ZN5Test11fEv
 const char *f() {
   try {

Modified: cfe/branches/tooling/test/CodeGenCXX/value-init.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/value-init.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/value-init.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/value-init.cpp Fri Jan 20 10:14:22 2012
@@ -134,8 +134,7 @@
   // CHECK: define i32 @_ZN8zeroinit4testEv()
   int test() {
     // CHECK: call void @llvm.memset.p0i8.i64
-    // CHECK: getelementptr
-    // CHECK: ret i32
+    // CHECK: ret i32 0
     return S().i;
   }
 

Modified: cfe/branches/tooling/test/CodeGenCXX/visibility-inlines-hidden.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/visibility-inlines-hidden.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/visibility-inlines-hidden.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/visibility-inlines-hidden.cpp Fri Jan 20 10:14:22 2012
@@ -97,3 +97,14 @@
 
   // CHECK: define available_externally void @_ZN5test22ns3fooINS_1BINS_1AEEEEEvv()
 }
+
+namespace PR11642 {
+  template <typename T>
+  class Foo {
+  public:
+    T foo(T x) { return x; }
+  };
+  extern template class Foo<int>;
+  template class Foo<int>;
+  // CHECK: define weak_odr i32 @_ZN7PR116423FooIiE3fooEi
+}

Modified: cfe/branches/tooling/test/CodeGenCXX/visibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/visibility.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/visibility.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/visibility.cpp Fri Jan 20 10:14:22 2012
@@ -403,10 +403,7 @@
     B<A<2> >::test4();
   }
 
-  // CHECK: declare void @_ZN6Test201BINS_1AILj2EEEE5test5Ev()
-  // (but explicit visibility on a template argument doesn't count as
-  //  explicit visibility for the template for purposes of deciding
-  //  whether an external symbol gets visibility)
+  // CHECK: declare hidden void @_ZN6Test201BINS_1AILj2EEEE5test5Ev()
   void test5() {
     B<A<2> >::test5();
   }
@@ -454,3 +451,52 @@
   // CHECK-HIDDEN: declare void @_ZN6test221BINS_2A2EE3fooEv()
   // CHECK-HIDDEN: define linkonce_odr hidden void @_ZN6test221BINS_2A2EE3barEv()
 }
+
+namespace PR10113 {
+  namespace foo DEFAULT {
+    template<typename T>
+      class bar {
+      void zed() {}
+    };
+  }
+  template class foo::bar<char>;
+  // CHECK: define weak_odr void @_ZN7PR101133foo3barIcE3zedEv
+  // CHECK-HIDDEN: define weak_odr void @_ZN7PR101133foo3barIcE3zedEv
+
+  struct zed {
+  };
+  template class foo::bar<zed>;
+  // CHECK: define weak_odr void @_ZN7PR101133foo3barINS_3zedEE3zedEv
+  // CHECK-HIDDEN: define weak_odr void @_ZN7PR101133foo3barINS_3zedEE3zedEv
+}
+
+namespace PR11690 {
+  template<class T> struct Class {
+    void size() const {
+    }
+  };
+  template class DEFAULT Class<char>;
+  // CHECK: define weak_odr void @_ZNK7PR116905ClassIcE4sizeEv
+  // CHECK-HIDDEN: define weak_odr void @_ZNK7PR116905ClassIcE4sizeEv
+
+  template<class T> void Method() {}
+  template  DEFAULT void Method<char>();
+  // CHECK: define weak_odr void @_ZN7PR116906MethodIcEEvv
+  // CHECK-HIDDEN: define weak_odr void @_ZN7PR116906MethodIcEEvv
+}
+
+namespace PR11690_2 {
+  namespace foo DEFAULT {
+    class bar;
+    template<typename T1, typename T2 = bar>
+    class zed {
+      void bar() {
+      }
+    };
+  }
+  struct baz {
+  };
+  template class foo::zed<baz>;
+  // CHECK: define weak_odr void @_ZN9PR11690_23foo3zedINS_3bazENS0_3barEE3barEv
+  // CHECK-HIDDEN: define weak_odr void @_ZN9PR11690_23foo3zedINS_3bazENS0_3barEE3barEv
+}

Modified: cfe/branches/tooling/test/CodeGenCXX/vla.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/vla.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/vla.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/vla.cpp Fri Jan 20 10:14:22 2012
@@ -1,5 +1,19 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s
 
+template<typename T>
+struct S {
+  static int n;
+};
+template<typename T> int S<T>::n = 5;
+
+int f() {
+  // Make sure that the reference here is enough to trigger the instantiation of
+  // the static data member.
+  // CHECK: @_ZN1SIiE1nE = weak_odr global i32 5
+  int a[S<int>::n];
+  return sizeof a;
+}
+
 // rdar://problem/9506377
 void test0(void *array, int n) {
   // CHECK: define void @_Z5test0Pvi(
@@ -40,4 +54,3 @@
 
   // CHECK-NEXT: ret void
 }
-

Modified: cfe/branches/tooling/test/CodeGenObjC/constant-strings.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenObjC/constant-strings.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenObjC/constant-strings.m (original)
+++ cfe/branches/tooling/test/CodeGenObjC/constant-strings.m Fri Jan 20 10:14:22 2012
@@ -8,11 +8,9 @@
 // RUN: %clang_cc1 -fgnu-runtime -emit-llvm -o %t %s
 // RUN: FileCheck --check-prefix=CHECK-GNU < %t %s
 // CHECK-GNU: NXConstantString
-// CHECK-GNU-NOT: NXConstantString
 
 // RUN: %clang_cc1 -fgnu-runtime -fconstant-string-class NSConstantString -emit-llvm -o %t %s
 // RUN: FileCheck --check-prefix=CHECK-GNU-WITH-CLASS < %t %s
 // CHECK-GNU-WITH-CLASS: NSConstantString
-// CHECK-GNU-WITH-CLASS-NOT: NSConstantString
 id a = @"Hello World!";
 

Modified: cfe/branches/tooling/test/CodeGenObjC/forward-class-impl-metadata.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenObjC/forward-class-impl-metadata.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenObjC/forward-class-impl-metadata.m (original)
+++ cfe/branches/tooling/test/CodeGenObjC/forward-class-impl-metadata.m Fri Jan 20 10:14:22 2012
@@ -39,3 +39,9 @@
 @implementation A
 @synthesize p0 = _p0;
 @end
+
+ at interface B
+ at end
+ at class B;
+ at implementation B
+ at end

Modified: cfe/branches/tooling/test/CodeGenObjCXX/property-reference.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenObjCXX/property-reference.mm?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenObjCXX/property-reference.mm (original)
+++ cfe/branches/tooling/test/CodeGenObjCXX/property-reference.mm Fri Jan 20 10:14:22 2012
@@ -35,7 +35,7 @@
 @interface Test1 {
   test1::A ivar;
 }
- at property const test1::A &prop1;
+ at property (nonatomic) const test1::A &prop1;
 @end
 @implementation Test1
 @synthesize prop1 = ivar;

Modified: cfe/branches/tooling/test/Driver/darwin-debug-flags.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-debug-flags.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-debug-flags.c (original)
+++ cfe/branches/tooling/test/Driver/darwin-debug-flags.c Fri Jan 20 10:14:22 2012
@@ -1,5 +1,7 @@
 // RUN: env RC_DEBUG_OPTIONS=1 %clang -ccc-host-triple i386-apple-darwin9 -g -Os %s  -emit-llvm -S -o - | FileCheck %s
 // <rdar://problem/7256886>
+// RUN: touch %t.s
+// RUN: env RC_DEBUG_OPTIONS=1 %clang -### -ccc-host-triple i386-apple-darwin9 -c -g %t.s 2>&1 | FileCheck -check-prefix=S %s
 
 // CHECK: !0 = metadata !{
 // CHECK: -g -Os
@@ -7,3 +9,5 @@
 // CHECK: [ DW_TAG_compile_unit ]
 
 int x;
+
+// S: "-dwarf-debug-flags"

Modified: cfe/branches/tooling/test/Driver/darwin-ld.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/darwin-ld.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/darwin-ld.c (original)
+++ cfe/branches/tooling/test/Driver/darwin-ld.c Fri Jan 20 10:14:22 2012
@@ -95,3 +95,17 @@
 //
 // FORCE_LOAD: {{ld(.exe)?"}}
 // FORCE_LOAD: "-force_load" "a" "-force_load" "b"
+
+// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \
+// RUN:   -lazy_framework Framework 2> %t.log
+//
+// RUN: FileCheck -check-prefix=LINK_LAZY_FRAMEWORK %s < %t.log
+// LINK_LAZY_FRAMEWORK: {{ld(.exe)?"}}
+// LINK_LAZY_FRAMEWORK: "-lazy_framework" "Framework"
+
+// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \
+// RUN:   -lazy_library Library 2> %t.log
+//
+// RUN: FileCheck -check-prefix=LINK_LAZY_LIBRARY %s < %t.log
+// LINK_LAZY_LIBRARY: {{ld(.exe)?"}}
+// LINK_LAZY_LIBRARY: "-lazy_library" "Library"

Modified: cfe/branches/tooling/test/Driver/ios-simulator-arcruntime.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/ios-simulator-arcruntime.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/ios-simulator-arcruntime.c (original)
+++ cfe/branches/tooling/test/Driver/ios-simulator-arcruntime.c Fri Jan 20 10:14:22 2012
@@ -3,4 +3,5 @@
 // 
 
 // CHECK-OPTIONS1-NOT: -fobjc-runtime-has-weak
+// CHECK-OPTIONS2: "-triple" "i386-apple-ios5.0.0"
 // CHECK-OPTIONS2: -fobjc-runtime-has-weak

Modified: cfe/branches/tooling/test/Driver/linux-ld.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/linux-ld.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/linux-ld.c (original)
+++ cfe/branches/tooling/test/Driver/linux-ld.c Fri Jan 20 10:14:22 2012
@@ -171,3 +171,26 @@
 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../../lib64"
 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/lib/../lib64"
 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/../lib64"
+//
+// Check that we do not pass --hash-style=gnu and --hash-style=both to linker
+// when build for MIPS platforms.
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN:     -ccc-host-triple mips-linux-gnu -ccc-clang-archs mips \
+// RUN:   | FileCheck --check-prefix=CHECK-MIPS %s
+// CHECK-MIPS: "{{.*}}ld{{(.exe)?}}"
+// CHECK-MIPS-NOT: "--hash-style={{gnu|both}}"
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN:     -ccc-host-triple mipsel-linux-gnu -ccc-clang-archs mipsel \
+// RUN:   | FileCheck --check-prefix=CHECK-MIPSEL %s
+// CHECK-MIPSEL: "{{.*}}ld{{(.exe)?}}"
+// CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}"
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN:     -ccc-host-triple mips64-linux-gnu -ccc-clang-archs mips64 \
+// RUN:   | FileCheck --check-prefix=CHECK-MIPS64 %s
+// CHECK-MIPS64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}"
+// RUN: %clang %s -### -o %t.o 2>&1 \
+// RUN:     -ccc-host-triple mips64el-linux-gnu -ccc-clang-archs mips64el \
+// RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL %s
+// CHECK-MIPS64EL: "{{.*}}ld{{(.exe)?}}"
+// CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}"

Modified: cfe/branches/tooling/test/FixIt/fixit-cxx0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/FixIt/fixit-cxx0x.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/FixIt/fixit-cxx0x.cpp (original)
+++ cfe/branches/tooling/test/FixIt/fixit-cxx0x.cpp Fri Jan 20 10:14:22 2012
@@ -18,43 +18,31 @@
 using typename U = void; // expected-error {{name defined in alias declaration must be an identifier}}
 using typename ::V = void; // expected-error {{name defined in alias declaration must be an identifier}}
 
-namespace Constexpr {
-  extern constexpr int a; // expected-error {{must be a definition}}
-  // -> extern const int a;
-
-  extern constexpr int *b; // expected-error {{must be a definition}}
-  // -> extern int *const b;
-
-  extern constexpr int &c; // expected-error {{must be a definition}}
-  // -> extern int &b;
-
-  extern constexpr const int d; // expected-error {{must be a definition}}
-  // -> extern const int d;
-
-  int z;
-  constexpr int a = 0;
-  constexpr int *b = &z;
-  constexpr int &c = z;
-  constexpr int d = a;
+namespace SemiCommaTypo {
+  int m {},
+  n [[]], // expected-error {{expected ';' at end of declaration}}
+  int o;
 
-  // FIXME: Provide FixIts for static data members too.
-#if 0
-  struct S {
-    static constexpr int b; // xpected-error {{requires an initializer}}
-    // -> const int b;
+  struct Base {
+    virtual void f2(), f3();
   };
+  struct MemberDeclarator : Base {
+    int k : 4,
+        //[[]] : 1, FIXME: test this once we support attributes here
+        : 9, // expected-error {{expected ';' at end of declaration}}
+    char c, // expected-error {{expected ';' at end of declaration}}
+    typedef void F(), // expected-error {{expected ';' at end of declaration}}
+    F f1,
+      f2 final,
+      f3 override, // expected-error {{expected ';' at end of declaration}}
+  };
+}
 
-  constexpr int S::b = 0;
-#endif
+namespace ScopedEnum {
+  enum class E { a };
 
+  enum class E b = E::a; // expected-error {{must use 'enum' not 'enum class'}}
   struct S {
-    static char *const p = 0; // expected-error {{requires 'constexpr' specifier}}
-    // -> constexpr static char *const p = 0;
+    friend enum class E; // expected-error {{must use 'enum' not 'enum class'}}
   };
 }
-
-namespace SemiCommaTypo {
-  int m {},
-  n [[]], // expected-error {{expected ';' at end of declaration}}
-  int o;
-}

Modified: cfe/branches/tooling/test/FixIt/fixit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/FixIt/fixit.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/FixIt/fixit.cpp (original)
+++ cfe/branches/tooling/test/FixIt/fixit.cpp Fri Jan 20 10:14:22 2012
@@ -68,14 +68,68 @@
 };
 
 namespace rdar8488464 {
-int x == 0; // expected-error {{invalid '==' at end of declaration; did you mean '='?}}
+int x = 0;
+int x1 &= 0; // expected-error {{invalid '&=' at end of declaration; did you mean '='?}}
+int x2 *= 0; // expected-error {{invalid '*=' at end of declaration; did you mean '='?}}
+int x3 += 0; // expected-error {{invalid '+=' at end of declaration; did you mean '='?}}
+int x4 -= 0; // expected-error {{invalid '-=' at end of declaration; did you mean '='?}}
+int x5 != 0; // expected-error {{invalid '!=' at end of declaration; did you mean '='?}}
+int x6 /= 0; // expected-error {{invalid '/=' at end of declaration; did you mean '='?}}
+int x7 %= 0; // expected-error {{invalid '%=' at end of declaration; did you mean '='?}}
+int x8 <= 0; // expected-error {{invalid '<=' at end of declaration; did you mean '='?}}
+int x9 <<= 0; // expected-error {{invalid '<<=' at end of declaration; did you mean '='?}}
+int x10 >= 0; // expected-error {{invalid '>=' at end of declaration; did you mean '='?}}
+int x11 >>= 0; // expected-error {{invalid '>>=' at end of declaration; did you mean '='?}}
+int x12 ^= 0; // expected-error {{invalid '^=' at end of declaration; did you mean '='?}}
+int x13 |= 0; // expected-error {{invalid '|=' at end of declaration; did you mean '='?}}
+int x14 == 0; // expected-error {{invalid '==' at end of declaration; did you mean '='?}}
 
 void f() {
-    int x == 0; // expected-error {{invalid '==' at end of declaration; did you mean '='?}}
+    int x = 0;
     (void)x;
-    if (int x == 0) { // expected-error {{invalid '==' at end of declaration; did you mean '='?}}
-      (void)x;
-    }
+    int x1 &= 0; // expected-error {{invalid '&=' at end of declaration; did you mean '='?}}
+    (void)x1;
+    int x2 *= 0; // expected-error {{invalid '*=' at end of declaration; did you mean '='?}}
+    (void)x2;
+    int x3 += 0; // expected-error {{invalid '+=' at end of declaration; did you mean '='?}}
+    (void)x3;
+    int x4 -= 0; // expected-error {{invalid '-=' at end of declaration; did you mean '='?}}
+    (void)x4;
+    int x5 != 0; // expected-error {{invalid '!=' at end of declaration; did you mean '='?}}
+    (void)x5;
+    int x6 /= 0; // expected-error {{invalid '/=' at end of declaration; did you mean '='?}}
+    (void)x6;
+    int x7 %= 0; // expected-error {{invalid '%=' at end of declaration; did you mean '='?}}
+    (void)x7;
+    int x8 <= 0; // expected-error {{invalid '<=' at end of declaration; did you mean '='?}}
+    (void)x8;
+    int x9 <<= 0; // expected-error {{invalid '<<=' at end of declaration; did you mean '='?}}
+    (void)x9;
+    int x10 >= 0; // expected-error {{invalid '>=' at end of declaration; did you mean '='?}}
+    (void)x10;
+    int x11 >>= 0; // expected-error {{invalid '>>=' at end of declaration; did you mean '='?}}
+    (void)x11;
+    int x12 ^= 0; // expected-error {{invalid '^=' at end of declaration; did you mean '='?}}
+    (void)x12;
+    int x13 |= 0; // expected-error {{invalid '|=' at end of declaration; did you mean '='?}}
+    (void)x13;
+    int x14 == 0; // expected-error {{invalid '==' at end of declaration; did you mean '='?}}
+    (void)x14;
+    if (int x = 0)  { (void)x; }
+    if (int x1 &= 0) { (void)x1; } // expected-error {{invalid '&=' at end of declaration; did you mean '='?}}
+    if (int x2 *= 0) { (void)x2; } // expected-error {{invalid '*=' at end of declaration; did you mean '='?}}
+    if (int x3 += 0) { (void)x3; } // expected-error {{invalid '+=' at end of declaration; did you mean '='?}}
+    if (int x4 -= 0) { (void)x4; } // expected-error {{invalid '-=' at end of declaration; did you mean '='?}}
+    if (int x5 != 0) { (void)x5; } // expected-error {{invalid '!=' at end of declaration; did you mean '='?}}
+    if (int x6 /= 0) { (void)x6; } // expected-error {{invalid '/=' at end of declaration; did you mean '='?}}
+    if (int x7 %= 0) { (void)x7; } // expected-error {{invalid '%=' at end of declaration; did you mean '='?}}
+    if (int x8 <= 0) { (void)x8; } // expected-error {{invalid '<=' at end of declaration; did you mean '='?}}
+    if (int x9 <<= 0) { (void)x9; } // expected-error {{invalid '<<=' at end of declaration; did you mean '='?}}
+    if (int x10 >= 0) { (void)x10; } // expected-error {{invalid '>=' at end of declaration; did you mean '='?}}
+    if (int x11 >>= 0) { (void)x11; } // expected-error {{invalid '>>=' at end of declaration; did you mean '='?}}
+    if (int x12 ^= 0) { (void)x12; } // expected-error {{invalid '^=' at end of declaration; did you mean '='?}}
+    if (int x13 |= 0) { (void)x13; } // expected-error {{invalid '|=' at end of declaration; did you mean '='?}}
+    if (int x14 == 0) { (void)x14; } // expected-error {{invalid '==' at end of declaration; did you mean '='?}}
 }
 }
 
@@ -125,6 +179,19 @@
   AD ad, // expected-error {{expected ';' at end of declaration}}
   return ad;
 }
+struct MoreAccidentalCommas {
+  int a : 5,
+      b : 7,
+        : 4, // expected-error {{expected ';' at end of declaration}}
+  char c, // expected-error {{expected ';' at end of declaration}}
+  double d, // expected-error {{expected ';' at end of declaration}}
+  MoreAccidentalCommas *next, // expected-error {{expected ';' at end of declaration}}
+public:
+  int k, // expected-error {{expected ';' at end of declaration}}
+  friend void f(MoreAccidentalCommas) {}
+  int k2, // expected-error {{expected ';' at end of declaration}}
+  virtual void g(), // expected-error {{expected ';' at end of declaration}}
+};
 
 template<class T> struct Mystery;
 template<class T> typedef Mystery<T>::type getMysteriousThing() { // \

Modified: cfe/branches/tooling/test/Index/TestClassDecl.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/TestClassDecl.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/TestClassDecl.m (original)
+++ cfe/branches/tooling/test/Index/TestClassDecl.m Fri Jan 20 10:14:22 2012
@@ -16,7 +16,7 @@
 }
 
 // CHECK-scan: [1:1 - 8:1] Invalid Cursor => NoDeclFound
-// CHECK-scan: [8:1 - 8:8] UnexposedDecl=[8:8]
+// CHECK-scan: [8:1 - 8:8] UnexposedDecl=Foo:8:8
 // CHECK-scan: [8:8 - 8:11] ObjCClassRef=Foo:10:12
 // CHECK-scan: [8:11 - 10:1] Invalid Cursor => NoDeclFound
 // CHECK-scan: [10:1 - 11:5] ObjCInterfaceDecl=Foo:10:12

Modified: cfe/branches/tooling/test/Index/TestClassForwardDecl.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/TestClassForwardDecl.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/TestClassForwardDecl.m (original)
+++ cfe/branches/tooling/test/Index/TestClassForwardDecl.m Fri Jan 20 10:14:22 2012
@@ -13,7 +13,7 @@
 }
 
 // CHECK-scan: [1:1 - 8:1] Invalid Cursor => NoDeclFound
-// CHECK-scan: [8:1 - 8:8] UnexposedDecl=[8:8]
+// CHECK-scan: [8:1 - 8:8] UnexposedDecl=Foo:8:8
 // CHECK-scan: [8:8 - 8:11] ObjCClassRef=Foo:8:8
 // CHECK-scan: [8:11 - 10:1] Invalid Cursor => NoDeclFound
 // CHECK-scan: [10:1 - 10:15] FunctionDecl=function:10:6 (Definition)

Modified: cfe/branches/tooling/test/Index/annotate-tokens-pp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/annotate-tokens-pp.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/annotate-tokens-pp.c (original)
+++ cfe/branches/tooling/test/Index/annotate-tokens-pp.c Fri Jan 20 10:14:22 2012
@@ -124,7 +124,7 @@
 // CHECK: Punctuation: "," [16:26 - 16:27]
 // CHECK: Identifier: "z" [16:27 - 16:28] DeclRefExpr=z:14:7
 // FIXME: The token below should really be annotated as "macro expansion=REVERSE_MACRO:10:9"
-// CHECK: Punctuation: ")" [16:28 - 16:29] VarDecl=k:16:7 (Definition)
+// CHECK: Punctuation: ")" [16:28 - 16:29] DeclStmt=
 // CHECK: Punctuation: ";" [16:29 - 16:30] DeclStmt=
 // CHECK: Keyword: "int" [17:3 - 17:6] VarDecl=j:17:7 (Definition)
 // CHECK: Identifier: "j" [17:7 - 17:8] VarDecl=j:17:7 (Definition)
@@ -135,7 +135,7 @@
 // CHECK: Punctuation: "+" [17:25 - 17:26] BinaryOperator=
 // CHECK: Identifier: "k" [17:27 - 17:28] DeclRefExpr=k:16:7
 // FIXME: The token below should really be annotated as "macro expansion=TWICE_MACRO:11:9"
-// CHECK: Punctuation: ")" [17:28 - 17:29] VarDecl=j:17:7 (Definition)
+// CHECK: Punctuation: ")" [17:28 - 17:29] DeclStmt=
 // CHECK: Punctuation: ";" [17:29 - 17:30] DeclStmt=
 // CHECK: Keyword: "int" [18:3 - 18:6] VarDecl=w:18:7 (Definition)
 // CHECK: Identifier: "w" [18:7 - 18:8] VarDecl=w:18:7 (Definition)
@@ -189,7 +189,8 @@
 // CHECK: Identifier: "z" [25:43 - 25:44] DeclRefExpr=z:25:3
 // CHECK: Punctuation: ";" [25:44 - 25:45] CompoundStmt=
 // CHECK: Punctuation: "}" [25:46 - 25:47] CompoundStmt=
-// CHECK: Punctuation: ")" [25:47 - 25:48] DoStmt=
+// FIXME: The token below should really be annotated as "macro expansion=fun_with_macro_bodies:21:9"
+// CHECK: Punctuation: ")" [25:47 - 25:48] CompoundStmt=
 // CHECK: Punctuation: ";" [25:48 - 25:49] CompoundStmt=
 // CHECK: Punctuation: "}" [26:1 - 26:2] CompoundStmt=
 // CHECK: {{28:1.*inclusion directive=pragma-once.h.*multi-include guarded}}

Modified: cfe/branches/tooling/test/Index/annotate-tokens.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/annotate-tokens.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/annotate-tokens.m (original)
+++ cfe/branches/tooling/test/Index/annotate-tokens.m Fri Jan 20 10:14:22 2012
@@ -452,8 +452,8 @@
 // CHECK: Punctuation: ")" [88:24 - 88:25] ObjCProtocolExpr=Proto:85:1
 // CHECK: Punctuation: ";" [88:25 - 88:26] CompoundStmt=
 // CHECK: Punctuation: "}" [89:1 - 89:2] CompoundStmt=
-// CHECK: Punctuation: "@" [93:1 - 93:2] UnexposedDecl=[93:8]
-// CHECK: Keyword: "class" [93:2 - 93:7] UnexposedDecl=[93:8]
+// CHECK: Punctuation: "@" [93:1 - 93:2] UnexposedDecl=Rdar8595462_A:93:8
+// CHECK: Keyword: "class" [93:2 - 93:7] UnexposedDecl=Rdar8595462_A:93:8
 // CHECK: Identifier: "Rdar8595462_A" [93:8 - 93:21] ObjCClassRef=Rdar8595462_A:93:8
 // CHECK: Punctuation: ";" [93:21 - 93:22]
 // CHECK: Punctuation: "@" [94:1 - 94:2] ObjCInterfaceDecl=Rdar8595462_B:94:12

Modified: cfe/branches/tooling/test/Index/file-refs.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/file-refs.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/file-refs.m (original)
+++ cfe/branches/tooling/test/Index/file-refs.m Fri Jan 20 10:14:22 2012
@@ -43,6 +43,7 @@
 
 // RUN:  -file-refs-at=%s:7:18 \
 // CHECK:      ObjCImplementationDecl=Foo:7:17 (Definition)
+// CHECK-NEXT: UnexposedDecl=Foo:1:8 =[1:8 - 1:11]
 // CHECK-NEXT: ObjCClassRef=Foo:3:12 =[1:8 - 1:11]
 // CHECK-NEXT: ObjCInterfaceDecl=Foo:3:12 =[3:12 - 3:15]
 // CHECK-NEXT: ObjCImplementationDecl=Foo:7:17 (Definition) =[7:17 - 7:20]

Modified: cfe/branches/tooling/test/Index/properties-class-extensions.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/properties-class-extensions.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/properties-class-extensions.m (original)
+++ cfe/branches/tooling/test/Index/properties-class-extensions.m Fri Jan 20 10:14:22 2012
@@ -70,7 +70,7 @@
 // CHECK-NOT: properties-class-extensions.m:16:25: ObjCInstanceMethodDecl=bar:16:25 Extent=[16:25 - 16:28]
 // CHECK: properties-class-extensions.m:19:26: ObjCInstanceMethodDecl=setBar::19:26 Extent=[19:26 - 19:29]
 // CHECK: properties-class-extensions.m:19:26: ParmDecl=bar:19:26 (Definition) Extent=[19:26 - 19:29]
-// CHECK: properties-class-extensions.m:24:1: UnexposedDecl=[24:8] Extent=[24:1 - 24:23]
+// CHECK: properties-class-extensions.m:24:8: UnexposedDecl=Rdar8467189_Bar:24:8
 // CHECK: properties-class-extensions.m:24:8: ObjCClassRef=Rdar8467189_Bar:24:8 Extent=[24:8 - 24:23]
 // CHECK: properties-class-extensions.m:25:11: ObjCProtocolDecl=Rdar8467189_FooProtocol:25:11 (Definition) Extent=[25:1 - 27:5]
 // CHECK: properties-class-extensions.m:26:39: ObjCPropertyDecl=Rdar8467189_Bar:26:39 Extent=[26:1 - 26:54]

Modified: cfe/branches/tooling/test/Lexer/constants.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Lexer/constants.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Lexer/constants.c (original)
+++ cfe/branches/tooling/test/Lexer/constants.c Fri Jan 20 10:14:22 2012
@@ -66,4 +66,4 @@
 // PR7888
 double g = 1e100000000; // expected-warning {{too large}}
 
-char h = '\u1234'; // expected-warning {{character unicode escape sequence too long for its type}}
+char h = '\u1234'; // expected-error {{character too large for enclosing character literal type}}

Modified: cfe/branches/tooling/test/Lexer/escape_newline.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Lexer/escape_newline.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Lexer/escape_newline.c (original)
+++ cfe/branches/tooling/test/Lexer/escape_newline.c Fri Jan 20 10:14:22 2012
@@ -1,7 +1,11 @@
 // RUN: %clang_cc1 -E -trigraphs %s | grep -- ' ->'
 // RUN: %clang_cc1 -E -trigraphs %s 2>&1 | grep 'backslash and newline separated by space'
 // RUN: %clang_cc1 -E -trigraphs %s 2>&1 | grep 'trigraph converted'
+// RUN: %clang_cc1 -E -CC -trigraphs %s
 
 // This is an ugly way to spell a -> token.
  -??/      
 >
+
+// \
+

Modified: cfe/branches/tooling/test/Lexer/has_feature_c1x.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Lexer/has_feature_c1x.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Lexer/has_feature_c1x.c (original)
+++ cfe/branches/tooling/test/Lexer/has_feature_c1x.c Fri Jan 20 10:14:22 2012
@@ -1,6 +1,15 @@
 // RUN: %clang_cc1 -E -std=c1x %s -o - | FileCheck --check-prefix=CHECK-1X %s
 // RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
 
+#if __has_feature(c_atomic)
+int has_atomic();
+#else
+int no_atomic();
+#endif
+
+// CHECK-1X: has_atomic
+// CHECK-NO-1X: no_atomic
+
 #if __has_feature(c_static_assert)
 int has_static_assert();
 #else

Modified: cfe/branches/tooling/test/Lexer/has_feature_cxx0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Lexer/has_feature_cxx0x.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Lexer/has_feature_cxx0x.cpp (original)
+++ cfe/branches/tooling/test/Lexer/has_feature_cxx0x.cpp Fri Jan 20 10:14:22 2012
@@ -1,6 +1,15 @@
 // RUN: %clang_cc1 -E -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-0X %s
 // RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-0X %s
 
+#if __has_feature(cxx_atomic)
+int has_atomic();
+#else
+int no_atomic();
+#endif
+
+// CHECK-0X: has_atomic
+// CHECK-NO-0X: no_atomic
+
 #if __has_feature(cxx_lambdas)
 int has_lambdas();
 #else

Modified: cfe/branches/tooling/test/Lexer/utf8-char-literal.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Lexer/utf8-char-literal.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Lexer/utf8-char-literal.cpp (original)
+++ cfe/branches/tooling/test/Lexer/utf8-char-literal.cpp Fri Jan 20 10:14:22 2012
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -fsyntax-only -verify %s
 
-int array0[u'ñ' == u'\xf1'? 1 : -1];
-int array1['ñ' !=  u'\xf1'? 1 : -1];
+int array0[u'ñ' == u'\xf1'? 1 : -1];
+int array1['\xF1' !=  u'\xf1'? 1 : -1];
+int array1['ñ' !=  u'\xf1'? 1 : -1]; // expected-error {{character too large for enclosing character literal type}}

Modified: cfe/branches/tooling/test/Lexer/wchar.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Lexer/wchar.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Lexer/wchar.c (original)
+++ cfe/branches/tooling/test/Lexer/wchar.c Fri Jan 20 10:14:22 2012
@@ -1,9 +1,9 @@
 // RUN: %clang_cc1 -fsyntax-only -fshort-wchar -verify %s
 
 void f() {
-  (void)L"\U00010000";  // expected-warning {{character unicode escape sequence too long for its type}}
+  (void)L"\U00010000"; // unicode escape produces UTF-16 sequence, so no warning
 
-  (void)L'\U00010000';  // expected-warning {{character unicode escape sequence too long for its type}}
+  (void)L'\U00010000'; // expected-error {{character too large for enclosing character literal type}}
 
   (void)L'ab';  // expected-warning {{extraneous characters in character constant ignored}}
 

Modified: cfe/branches/tooling/test/Misc/warning-flags.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Misc/warning-flags.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Misc/warning-flags.c (original)
+++ cfe/branches/tooling/test/Misc/warning-flags.c Fri Jan 20 10:14:22 2012
@@ -17,7 +17,7 @@
 
 The list of warnings below should NEVER grow.  It should gradually shrink to 0.
 
-CHECK: Warnings without flags (270):
+CHECK: Warnings without flags (266):
 CHECK-NEXT:   ext_anon_param_requires_type_specifier
 CHECK-NEXT:   ext_anonymous_struct_union_qualified
 CHECK-NEXT:   ext_array_init_copy
@@ -25,7 +25,6 @@
 CHECK-NEXT:   ext_cast_fn_obj
 CHECK-NEXT:   ext_delete_void_ptr_operand
 CHECK-NEXT:   ext_designated_init
-CHECK-NEXT:   ext_designated_init_cxx
 CHECK-NEXT:   ext_duplicate_declspec
 CHECK-NEXT:   ext_ellipsis_exception_spec
 CHECK-NEXT:   ext_empty_fnmacro_arg
@@ -36,7 +35,6 @@
 CHECK-NEXT:   ext_expected_semi_decl_list
 CHECK-NEXT:   ext_explicit_instantiation_without_qualified_id
 CHECK-NEXT:   ext_explicit_specialization_storage_class
-CHECK-NEXT:   ext_expr_not_ice
 CHECK-NEXT:   ext_extra_ivar_semi
 CHECK-NEXT:   ext_extra_struct_semi
 CHECK-NEXT:   ext_forward_ref_enum
@@ -56,7 +54,6 @@
 CHECK-NEXT:   ext_new_paren_array_nonconst
 CHECK-NEXT:   ext_nonstandard_escape
 CHECK-NEXT:   ext_param_not_declared
-CHECK-NEXT:   ext_param_promoted_not_compatible_with_prototype
 CHECK-NEXT:   ext_paste_comma
 CHECK-NEXT:   ext_plain_complex
 CHECK-NEXT:   ext_pp_bad_vaargs_use
@@ -213,7 +210,6 @@
 CHECK-NEXT:   warn_odr_tag_type_inconsistent
 CHECK-NEXT:   warn_on_superclass_use
 CHECK-NEXT:   warn_param_default_argument_redefinition
-CHECK-NEXT:   warn_parens_disambiguated_as_function_decl
 CHECK-NEXT:   warn_partial_specs_not_deducible
 CHECK-NEXT:   warn_pointer_attribute_wrong_type
 CHECK-NEXT:   warn_pp_convert_lhs_to_positive

Modified: cfe/branches/tooling/test/Modules/Inputs/DependsOnModule.framework/Headers/DependsOnModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/DependsOnModule.framework/Headers/DependsOnModule.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/DependsOnModule.framework/Headers/DependsOnModule.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/DependsOnModule.framework/Headers/DependsOnModule.h Fri Jan 20 10:14:22 2012
@@ -1,5 +1,5 @@
 #include <Module/Module.h> //expected-warning{{treating #include as an import of module 'Module'}}
 
 #define DEPENDS_ON_MODULE 1
-#__private_macro__ DEPENDS_ON_MODULE
+#__private_macro DEPENDS_ON_MODULE
 

Modified: cfe/branches/tooling/test/Modules/Inputs/DependsOnModule.framework/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/DependsOnModule.framework/module.map?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/DependsOnModule.framework/module.map (original)
+++ cfe/branches/tooling/test/Modules/Inputs/DependsOnModule.framework/module.map Fri Jan 20 10:14:22 2012
@@ -4,6 +4,11 @@
   module * {
     export *
   }
+  explicit module CXX {
+    requires cplusplus
+    header "cxx_other.h"
+  }
+
   explicit framework module SubFramework {
     umbrella header "SubFramework.h"
 

Modified: cfe/branches/tooling/test/Modules/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h Fri Jan 20 10:14:22 2012
@@ -1,5 +1,5 @@
 #ifndef MODULE_SUBFRAMEWORK_H
 #define MODULE_SUBFRAMEWORK_H
-#__private_macro__ MODULE_SUBFRAMEWORK_H
+#__private_macro MODULE_SUBFRAMEWORK_H
 char *module_subframework;
 #endif

Modified: cfe/branches/tooling/test/Modules/Inputs/Module.framework/Headers/Module.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/Module.framework/Headers/Module.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/Module.framework/Headers/Module.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/Module.framework/Headers/Module.h Fri Jan 20 10:14:22 2012
@@ -1,3 +1,5 @@
+// expected-warning{{umbrella header}}
+
 #ifndef MODULE_H
 #define MODULE_H
 const char *getModuleVersion(void);
@@ -12,7 +14,7 @@
 @end
 
 #define MODULE_H_MACRO 1
-#__private_macro__ MODULE_H_MACRO
+#__private_macro MODULE_H_MACRO
 
 #include <Module/Sub.h>
 #include <Module/Buried/Treasure.h>

Modified: cfe/branches/tooling/test/Modules/Inputs/MutuallyRecursive1.framework/Headers/MutuallyRecursive1.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/MutuallyRecursive1.framework/Headers/MutuallyRecursive1.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/MutuallyRecursive1.framework/Headers/MutuallyRecursive1.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/MutuallyRecursive1.framework/Headers/MutuallyRecursive1.h Fri Jan 20 10:14:22 2012
@@ -1,3 +1,3 @@
 
-__import_module__ MutuallyRecursive2;
+ at import MutuallyRecursive2;
 

Modified: cfe/branches/tooling/test/Modules/Inputs/MutuallyRecursive2.framework/Headers/MutuallyRecursive2.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/MutuallyRecursive2.framework/Headers/MutuallyRecursive2.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/MutuallyRecursive2.framework/Headers/MutuallyRecursive2.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/MutuallyRecursive2.framework/Headers/MutuallyRecursive2.h Fri Jan 20 10:14:22 2012
@@ -1,6 +1,6 @@
 
 
-__import_module__ MutuallyRecursive1;
+ at import MutuallyRecursive1;
 
 
 

Modified: cfe/branches/tooling/test/Modules/Inputs/NoUmbrella.framework/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/NoUmbrella.framework/module.map?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/NoUmbrella.framework/module.map (original)
+++ cfe/branches/tooling/test/Modules/Inputs/NoUmbrella.framework/module.map Fri Jan 20 10:14:22 2012
@@ -1,4 +1,9 @@
 framework module NoUmbrella {
   umbrella "Headers"
   module * { }
-}
\ No newline at end of file
+
+  module unavailable {
+    requires unavailable
+    header "Boom.h"
+  }
+}

Modified: cfe/branches/tooling/test/Modules/Inputs/category_bottom.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/category_bottom.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/category_bottom.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/category_bottom.h Fri Jan 20 10:14:22 2012
@@ -1,10 +1,10 @@
-__import_module__ category_left;
+ at import category_left;
 
 @interface Foo(Bottom)
 -(void)bottom;
 @end
 
-__import_module__ category_right;
+ at import category_right;
 
 @interface LeftFoo(Bottom)
 -(void)bottom;

Modified: cfe/branches/tooling/test/Modules/Inputs/category_left.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/category_left.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/category_left.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/category_left.h Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-__import_module__ category_top;
+ at import category_top;
 
 @interface Foo(Left)
 -(void)left;

Modified: cfe/branches/tooling/test/Modules/Inputs/category_right.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/category_right.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/category_right.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/category_right.h Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-__import_module__ category_top;
+ at import category_top;
 
 @interface Foo(Right1)
 -(void)right1;

Modified: cfe/branches/tooling/test/Modules/Inputs/def.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/def.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/def.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/def.h Fri Jan 20 10:14:22 2012
@@ -1,7 +1,11 @@
- at interface A
+#include "def-include.h"
+
+
+
+ at interface A {
+ at public
+  int ivar;
+}
 @end
 
-struct B {
-  int b1;
-};
 

Modified: cfe/branches/tooling/test/Modules/Inputs/diamond.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/diamond.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/diamond.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/diamond.h Fri Jan 20 10:14:22 2012
@@ -1 +1 @@
-__import_module__ diamond_bottom;
+ at import diamond_bottom;

Modified: cfe/branches/tooling/test/Modules/Inputs/diamond_bottom.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/diamond_bottom.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/diamond_bottom.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/diamond_bottom.h Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-__import_module__ diamond_left;
-__import_module__ diamond_right;
+ at import diamond_left;
+ at import diamond_right;
 
 char bottom(char *x);

Modified: cfe/branches/tooling/test/Modules/Inputs/diamond_left.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/diamond_left.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/diamond_left.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/diamond_left.h Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-__import_module__ diamond_top;
+ at import diamond_top;
 
 float left(float *);
 

Modified: cfe/branches/tooling/test/Modules/Inputs/diamond_right.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/diamond_right.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/diamond_right.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/diamond_right.h Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-__import_module__ diamond_top;
+ at import diamond_top;
 
 double right(double *);
 

Modified: cfe/branches/tooling/test/Modules/Inputs/macros.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/macros.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/macros.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/macros.h Fri Jan 20 10:14:22 2012
@@ -3,8 +3,8 @@
 #define FLOAT float
 #define DOUBLE double
 
-#__export_macro__ INTEGER
-#__private_macro__ FLOAT
-#__private_macro__ MODULE
+#__public_macro INTEGER
+#__private_macro FLOAT
+#__private_macro MODULE
 
 int (INTEGER);

Modified: cfe/branches/tooling/test/Modules/Inputs/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/module.map?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/module.map (original)
+++ cfe/branches/tooling/test/Modules/Inputs/module.map Fri Jan 20 10:14:22 2012
@@ -41,4 +41,37 @@
   explicit module Decl { header "decl.h" }
   explicit module Decl2 { header "decl2.h" }
   explicit module Def { header "def.h" }
-}
\ No newline at end of file
+}
+
+module redecl_merge_top { 
+  header "redecl-merge-top.h"
+  explicit module Explicit { header "redecl-merge-top-explicit.h" }
+}
+module redecl_merge_left { 
+  header "redecl-merge-left.h" 
+  export *
+}
+module redecl_merge_left_left { 
+  header "redecl-merge-left-left.h" 
+  export *
+}
+module redecl_merge_right { 
+  header "redecl-merge-right.h" 
+  export *
+}
+module redecl_merge_bottom { 
+  header "redecl-merge-bottom.h" 
+  export *
+}
+module namespaces_top { 
+  header "namespaces-top.h"
+  export *
+}
+module namespaces_left { 
+  header "namespaces-left.h"
+  export *
+}
+module namespaces_right { 
+  header "namespaces-right.h"
+  export *
+}

Modified: cfe/branches/tooling/test/Modules/Inputs/module_private_left.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/module_private_left.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/module_private_left.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/module_private_left.h Fri Jan 20 10:14:22 2012
@@ -1,6 +1,6 @@
 __module_private__ struct HiddenStruct;
 
-struct HiddenStruct {
+__module_private__ struct HiddenStruct {
 };
 
 
@@ -10,17 +10,17 @@
 __module_private__ void f1(T*);
 
 template<typename T>
-void f1(T*);
+__module_private__ void f1(T*);
 
 template<typename T>
 __module_private__ class vector;
 
 template<typename T>
-class vector {
+__module_private__ class vector {
 };
 
 vector<float> vec_float;
 
 typedef __module_private__ int Integer;
-typedef int Integer;
+typedef __module_private__ int Integer;
 

Modified: cfe/branches/tooling/test/Modules/Inputs/module_private_right.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/module_private_right.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/module_private_right.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/module_private_right.h Fri Jan 20 10:14:22 2012
@@ -1,5 +1,5 @@
 __module_private__ double &f0(double);
-double &f0(double);
+__module_private__ double &f0(double);
 
 __module_private__ int hidden_var;
 

Modified: cfe/branches/tooling/test/Modules/Inputs/wildcard-submodule-exports/C_one.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/wildcard-submodule-exports/C_one.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/wildcard-submodule-exports/C_one.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/wildcard-submodule-exports/C_one.h Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-__import_module__ A.One;
-__import_module__ B.One;
+ at import A.One;
+ at import B.One;
 
 long *C1;

Modified: cfe/branches/tooling/test/Modules/Inputs/wildcard-submodule-exports/C_two.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/Inputs/wildcard-submodule-exports/C_two.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/Inputs/wildcard-submodule-exports/C_two.h (original)
+++ cfe/branches/tooling/test/Modules/Inputs/wildcard-submodule-exports/C_two.h Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-__import_module__ A.Two;
-__import_module__ B.Two;
+ at import A.Two;
+ at import B.Two;
 
 unsigned long *C2;

Modified: cfe/branches/tooling/test/Modules/auto-module-import.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/auto-module-import.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/auto-module-import.m (original)
+++ cfe/branches/tooling/test/Modules/auto-module-import.m Fri Jan 20 10:14:22 2012
@@ -1,7 +1,7 @@
 // other file: expected-note{{'no_umbrella_A_private' declared here}}
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify
+// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify
 
 #include <DependsOnModule/DependsOnModule.h> // expected-warning{{treating #include as an import of module 'DependsOnModule'}}
 
@@ -54,7 +54,7 @@
 
 int getDependsOnModulePrivate() { return depends_on_module_private; }
 
-#include <Module/ModulePrivate.h> // expected-warning{{treating #include as an import of module 'Module.Private.ModulePrivate'}}
+#include <Module/ModulePrivate.h> // includes the header
 
 int getModulePrivate() { return module_private; }
 
@@ -62,3 +62,12 @@
 int getNoUmbrellaAPrivate() { return no_umbrella_A_private; }
 
 int getNoUmbrellaBPrivateFail() { return no_umbrella_B_private; } // expected-error{{use of undeclared identifier 'no_umbrella_B_private'; did you mean 'no_umbrella_A_private'?}}
+
+// Test inclusion of headers that are under an umbrella directory but
+// not actually part of the module.
+#include <Module/NotInModule.h> // expected-warning{{treating #include as an import of module 'Module.NotInModule'}} \
+  // expected-warning{{missing submodule 'Module.NotInModule'}}
+
+int getNotInModule() {
+  return not_in_module;
+}

Modified: cfe/branches/tooling/test/Modules/cycles.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/cycles.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/cycles.c (original)
+++ cfe/branches/tooling/test/Modules/cycles.c Fri Jan 20 10:14:22 2012
@@ -1,12 +1,12 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs %s 2>&1 | FileCheck %s
-
-__import_module__ MutuallyRecursive1;
+// RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -F %S/Inputs %s 2>&1 | FileCheck %s
+// FIXME: When we have a syntax for modules in C, use that.
+ at import MutuallyRecursive1;
 
 // FIXME: Lots of redundant diagnostics here, because the preprocessor
 // can't currently tell the parser not to try to load the module again.
 
-// CHECK: MutuallyRecursive2.h:3:19: fatal error: cyclic dependency in module 'MutuallyRecursive1': MutuallyRecursive1 -> MutuallyRecursive2 -> MutuallyRecursive1
-// CHECK: MutuallyRecursive1.h:2:19: fatal error: could not build module 'MutuallyRecursive2'
-// CHECK: cycles.c:4:19: fatal error: could not build module 'MutuallyRecursive1'
+// CHECK: MutuallyRecursive2.h:3:9: fatal error: cyclic dependency in module 'MutuallyRecursive1': MutuallyRecursive1 -> MutuallyRecursive2 -> MutuallyRecursive1
+// CHECK: MutuallyRecursive1.h:2:9: fatal error: could not build module 'MutuallyRecursive2'
+// CHECK: cycles.c:4:9: fatal error: could not build module 'MutuallyRecursive1'
 

Modified: cfe/branches/tooling/test/Modules/decldef.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/decldef.mm?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/decldef.mm (original)
+++ cfe/branches/tooling/test/Modules/decldef.mm Fri Jan 20 10:14:22 2012
@@ -1,15 +1,28 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -I %S/Inputs -fmodule-cache-path %t %s -verify
+// RUN: %clang_cc1 -fmodules -I %S/Inputs -fmodule-cache-path %t %s -verify
 
-__import_module__ decldef;
+
+// in other file: expected-note{{previous definition is here}}
+
+
+
+
+
+// in other file: expected-note{{previous definition is here}}
+
+ at import decldef;
 A *a1; // expected-error{{unknown type name 'A'}}
 B *b1; // expected-error{{unknown type name 'B'}}
-
-__import_module__ decldef.Decl;
+ at import decldef.Decl;
 
 A *a2;
 B *b;
 
+void testA(A *a) {
+  a->ivar = 17; // expected-error{{definition of 'A' must be imported before it is required}}
+}
+
 void testB() {
-  B b; // FIXME: Should error, because we can't see the definition.
+  B b; // expected-error{{definition of 'B' must be imported before it is required}}
+  B b2; // Note: the reundant error was silenced.
 }

Modified: cfe/branches/tooling/test/Modules/diamond-pch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/diamond-pch.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/diamond-pch.c (original)
+++ cfe/branches/tooling/test/Modules/diamond-pch.c Fri Jan 20 10:14:22 2012
@@ -19,9 +19,10 @@
 }
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=diamond_top %S/Inputs/module.map
-// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=diamond_left %S/Inputs/module.map
-// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=diamond_right %S/Inputs/module.map
-// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=diamond_bottom %S/Inputs/module.map
-// RUN: %clang_cc1 -emit-pch -fmodule-cache-path %t -o %t.pch %S/Inputs/diamond.h
-// RUN: %clang_cc1 -fmodule-cache-path %t -include-pch %t.pch %s -verify
+// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=diamond_top %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=diamond_left %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=diamond_right %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=diamond_bottom %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -emit-pch -fmodule-cache-path %t -o %t.pch %S/Inputs/diamond.h
+// RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -include-pch %t.pch %s -verify
+// FIXME: When we have a syntax for modules in C, use that.

Modified: cfe/branches/tooling/test/Modules/diamond.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/diamond.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/diamond.c (original)
+++ cfe/branches/tooling/test/Modules/diamond.c Fri Jan 20 10:14:22 2012
@@ -3,7 +3,7 @@
 
 // in diamond-bottom.h: expected-note{{passing argument to parameter 'x' here}}
 
-__import_module__ diamond_bottom;
+ at import diamond_bottom;
 
 void test_diamond(int i, float f, double d, char c) {
   top(&i);
@@ -21,8 +21,9 @@
 }
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=diamond_top %S/Inputs/module.map
-// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=diamond_left %S/Inputs/module.map
-// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=diamond_right %S/Inputs/module.map
-// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=diamond_bottom %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodule-cache-path %t %s -verify
+// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=diamond_top %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=diamond_left %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=diamond_right %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=diamond_bottom %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t %s -verify
+// FIXME: When we have a syntax for modules in C, use that.

Modified: cfe/branches/tooling/test/Modules/header-import.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/header-import.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/header-import.m (original)
+++ cfe/branches/tooling/test/Modules/header-import.m Fri Jan 20 10:14:22 2012
@@ -1,7 +1,7 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -I %S/Inputs -verify %s
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -F %S/Inputs -I %S/Inputs -verify %s
 
 #import "point.h"
-__import_module__ Module;
+ at import Module;
 #import "point.h"
 

Modified: cfe/branches/tooling/test/Modules/inferred-submodules.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/inferred-submodules.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/inferred-submodules.m (original)
+++ cfe/branches/tooling/test/Modules/inferred-submodules.m Fri Jan 20 10:14:22 2012
@@ -1,13 +1,13 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -x objective-c -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify
+// RUN: %clang_cc1 -x objective-c -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify
 
-__import_module__ Module.Sub;
+ at import Module.Sub;
 
 void test_Module_Sub() {
   int *ip = Module_Sub;
 }
 
-__import_module__ Module.Buried.Treasure;
+ at import Module.Buried.Treasure;
 
 void dig() {
   unsigned *up = Buried_Treasure;

Modified: cfe/branches/tooling/test/Modules/irgen.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/irgen.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/irgen.c (original)
+++ cfe/branches/tooling/test/Modules/irgen.c Fri Jan 20 10:14:22 2012
@@ -1,8 +1,9 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodule-cache-path %t -emit-module -fmodule-name=irgen -triple x86_64-apple-darwin10 %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodule-cache-path %t -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -emit-module -fmodule-name=irgen -triple x86_64-apple-darwin10 %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
+// FIXME: When we have a syntax for modules in C, use that.
 
-__import_module__ irgen;
+ at import irgen;
 
 // CHECK: define void @triple_value
 void triple_value(int *px) {

Modified: cfe/branches/tooling/test/Modules/load_failure.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/load_failure.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/load_failure.c (original)
+++ cfe/branches/tooling/test/Modules/load_failure.c Fri Jan 20 10:14:22 2012
@@ -1,20 +1,21 @@
 #ifdef NONEXISTENT
-__import_module__ load_nonexistent;
+ at import load_nonexistent;
 #endif
 
 #ifdef FAILURE
-__import_module__ load_failure;
+ at import load_failure;
 #endif
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -x c++ -fmodule-cache-path %t -fdisable-module-hash -emit-module -fmodule-name=load_failure %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodule-cache-path %t -fdisable-module-hash %s -DNONEXISTENT 2>&1 | FileCheck -check-prefix=CHECK-NONEXISTENT %s
-// CHECK-NONEXISTENT: load_failure.c:2:19: fatal error: module 'load_nonexistent' not found
+// RUN: %clang_cc1 -fmodules -x objective-c++ -fmodule-cache-path %t -fdisable-module-hash -emit-module -fmodule-name=load_failure %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -fdisable-module-hash %s -DNONEXISTENT 2>&1 | FileCheck -check-prefix=CHECK-NONEXISTENT %s
+// CHECK-NONEXISTENT: load_failure.c:2:9: fatal error: module 'load_nonexistent' not found
 
-// RUN: not %clang_cc1 -fmodule-cache-path %t -fdisable-module-hash %s -DFAILURE 2> %t.out
+// RUN: not %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -fdisable-module-hash %s -DFAILURE 2> %t.out
 // RUN: FileCheck -check-prefix=CHECK-FAILURE %s < %t.out
 
 // FIXME: Clean up diagnostic text below and give it a location
 // CHECK-FAILURE: error: C99 was disabled in PCH file but is currently enabled
+// FIXME: When we have a syntax for modules in C, use that.
 
 

Modified: cfe/branches/tooling/test/Modules/lookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/lookup.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/lookup.cpp (original)
+++ cfe/branches/tooling/test/Modules/lookup.cpp Fri Jan 20 10:14:22 2012
@@ -1,7 +1,8 @@
 
-#define import __import_module__
+#define import @import
 import lookup_left_cxx;
-#define IMPORT(X) __import_module__ X
+#undef import
+#define IMPORT(X) @import X
 IMPORT(lookup_right_cxx);
 
 void test(int i, float f) {
@@ -14,11 +15,18 @@
   ::f0(&f);
 }
 
+int import;
+
+void f() {
+ int import;
+}
+
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=lookup_left_cxx -x c++ %S/Inputs/module.map -verify
-// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=lookup_right_cxx -x c++ %S/Inputs/module.map -verify
-// RUN: %clang_cc1 -x c++ -fmodule-cache-path %t %s -verify
-// RUN: %clang_cc1 -ast-print -x c++ -fmodule-cache-path %t %s | FileCheck -check-prefix=CHECK-PRINT %s
+// RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodule-cache-path %t -fmodule-name=lookup_left_cxx %S/Inputs/module.map -verify
+// RUN: %clang_cc1 -fmodules -x objective-c++ -emit-module -fmodule-cache-path %t -fmodule-name=lookup_right_cxx %S/Inputs/module.map -verify
+// RUN: %clang_cc1 -fmodules -x objective-c++ -fmodule-cache-path %t %s -verify
+// RUN: %clang_cc1 -fmodules -ast-print -x objective-c++ -fmodule-cache-path %t %s | FileCheck -check-prefix=CHECK-PRINT %s
+// FIXME: When we have a syntax for modules in C++, use that.
 
 // CHECK-PRINT: int *f0(int *);
 // CHECK-PRINT: float *f0(float *);

Modified: cfe/branches/tooling/test/Modules/lookup.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/lookup.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/lookup.m (original)
+++ cfe/branches/tooling/test/Modules/lookup.m Fri Jan 20 10:14:22 2012
@@ -1,18 +1,18 @@
 
 // lookup_left.h: expected-note{{using}}
 // lookup_right.h: expected-note{{also found}}
-__import_module__ lookup_left_objc;
-__import_module__ lookup_right_objc;
+ at import lookup_left_objc;
+ at import lookup_right_objc;
 
 void test(id x) {
   [x method]; // expected-warning{{multiple methods named 'method' found}}
 }
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodule-cache-path %t -emit-module -x objective-c -fmodule-name=lookup_left_objc %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodule-cache-path %t -emit-module -x objective-c -fmodule-name=lookup_right_objc %S/Inputs/module.map
-// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -verify %s
-// RUN: %clang_cc1 -ast-print -x objective-c -fmodule-cache-path %t %s | FileCheck -check-prefix=CHECK-PRINT %s
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -emit-module -x objective-c -fmodule-name=lookup_left_objc %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -emit-module -x objective-c -fmodule-name=lookup_right_objc %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -verify %s
+// RUN: %clang_cc1 -fmodules -ast-print -x objective-c -fmodule-cache-path %t %s | FileCheck -check-prefix=CHECK-PRINT %s
 
 // CHECK-PRINT: - (int) method;
 // CHECK-PRINT: - (double) method

Modified: cfe/branches/tooling/test/Modules/macros.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/macros.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/macros.c (original)
+++ cfe/branches/tooling/test/Modules/macros.c Fri Jan 20 10:14:22 2012
@@ -1,9 +1,10 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=macros %S/Inputs/module.map
-// RUN: %clang_cc1 -verify -fmodule-cache-path %t %s
-// RUN: %clang_cc1 -E -fmodule-cache-path %t %s | FileCheck -check-prefix CHECK-PREPROCESSED %s
+// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=macros %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -verify -fmodule-cache-path %t %s
+// RUN: %clang_cc1 -E -fmodules -x objective-c -fmodule-cache-path %t %s | FileCheck -check-prefix CHECK-PREPROCESSED %s
+// FIXME: When we have a syntax for modules in C, use that.
 
-__import_module__ macros;
+ at import macros;
 
 #ifndef INTEGER
 #  error INTEGER macro should be visible
@@ -21,7 +22,7 @@
 double d;
 DOUBLE *dp = &d;
 
-#__export_macro__ WIBBLE // expected-error{{no macro named 'WIBBLE'}}
+#__public_macro WIBBLE // expected-error{{no macro named 'WIBBLE'}}
 
 void f() {
   // CHECK-PREPROCESSED: int i = INTEGER;

Modified: cfe/branches/tooling/test/Modules/module-private.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/module-private.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/module-private.cpp (original)
+++ cfe/branches/tooling/test/Modules/module-private.cpp Fri Jan 20 10:14:22 2012
@@ -1,10 +1,11 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodule-cache-path %t -fmodule-name=module_private_left -x c++ -emit-module %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodule-cache-path %t -fmodule-name=module_private_right -x c++ -emit-module %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodule-cache-path %t %s -verify
+// RUN: %clang_cc1 -fmodules -x objective-c++ -fmodule-cache-path %t -fmodule-name=module_private_left -emit-module %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c++ -fmodule-cache-path %t -fmodule-name=module_private_right -emit-module %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c++ -fmodule-cache-path %t %s -verify
+// FIXME: When we have a syntax for modules in C++, use that.
 
-__import_module__ module_private_left;
-__import_module__ module_private_right;
+ at import module_private_left;
+ at import module_private_right;
 
 void test() {
   int &ir = f0(1.0); // okay: f0() from 'right' is not visible
@@ -31,28 +32,28 @@
 
 // Check for private redeclarations of public entities.
 template<typename T>
-class public_class_template; // expected-note{{previous declaration is here}}
+class public_class_template;
 
 template<typename T>
-__module_private__ class public_class_template; // expected-error{{__module_private__ declaration of 'public_class_template' follows public declaration}}
+__module_private__ class public_class_template;
 
 
-typedef int public_typedef; // expected-note{{previous declaration is here}}
-typedef __module_private__ int public_typedef; // expected-error{{__module_private__ declaration of 'public_typedef' follows public declaration}}
+typedef int public_typedef;
+typedef __module_private__ int public_typedef;
 
-extern int public_var; // expected-note{{previous declaration is here}}
-extern __module_private__ int public_var; // expected-error{{__module_private__ declaration of 'public_var' follows public declaration}}
+extern int public_var;
+extern __module_private__ int public_var;
 
-void public_func(); // expected-note{{previous declaration is here}}
-__module_private__ void public_func(); // expected-error{{__module_private__ declaration of 'public_func' follows public declaration}}
+void public_func();
+__module_private__ void public_func();
 
 template<typename T>
-void public_func_template(); // expected-note{{previous declaration is here}}
+void public_func_template();
 template<typename T>
-__module_private__ void public_func_template(); // expected-error{{__module_private__ declaration of 'public_func_template' follows public declaration}}
+__module_private__ void public_func_template();
 
-struct public_struct; // expected-note{{previous declaration is here}}
-__module_private__ struct public_struct; // expected-error{{__module_private__ declaration of 'public_struct' follows public declaration}}
+struct public_struct;
+__module_private__ struct public_struct;
 
 // Check for attempts to make specializations private
 template<> __module_private__ void public_func_template<int>(); // expected-error{{template specialization cannot be declared __module_private__}}

Modified: cfe/branches/tooling/test/Modules/normal-module-map.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/normal-module-map.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/normal-module-map.cpp (original)
+++ cfe/branches/tooling/test/Modules/normal-module-map.cpp Fri Jan 20 10:14:22 2012
@@ -1,14 +1,14 @@
 // Note: inside the module. expected-note{{'nested_umbrella_a' declared here}}
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/normal-module-map %s -verify
+// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -fmodules -I %S/Inputs/normal-module-map %s -verify
 #include "Umbrella/umbrella_sub.h"
 
 int getUmbrella() { 
   return umbrella + umbrella_sub; 
 }
 
-__import_module__ Umbrella2;
+ at import Umbrella2;
 
 #include "a1.h"
 #include "b1.h"
@@ -18,7 +18,7 @@
   return a1 + b1 + nested2;
 }
 
-__import_module__ nested_umbrella.a;
+ at import nested_umbrella.a;
 
 int testNestedUmbrellaA() {
   return nested_umbrella_a;
@@ -28,7 +28,7 @@
   return nested_umbrella_b; // expected-error{{use of undeclared identifier 'nested_umbrella_b'; did you mean 'nested_umbrella_a'?}}
 }
 
-__import_module__ nested_umbrella.b;
+ at import nested_umbrella.b;
 
 int testNestedUmbrellaB() {
   return nested_umbrella_b;

Modified: cfe/branches/tooling/test/Modules/objc-categories.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/objc-categories.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/objc-categories.m (original)
+++ cfe/branches/tooling/test/Modules/objc-categories.m Fri Jan 20 10:14:22 2012
@@ -1,11 +1,11 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_top -emit-module %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_left -emit-module %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_right -emit-module %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_bottom -emit-module %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodule-cache-path %t %s -verify
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -x objective-c -fmodule-name=category_top -emit-module %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -x objective-c -fmodule-name=category_left -emit-module %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -x objective-c -fmodule-name=category_right -emit-module %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -x objective-c -fmodule-name=category_bottom -emit-module %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t %s -verify
 
-__import_module__ category_bottom;
+ at import category_bottom;
 
 
 // in category_left.h: expected-note {{previous definition}}

Modified: cfe/branches/tooling/test/Modules/on-demand-build-warnings.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/on-demand-build-warnings.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/on-demand-build-warnings.m (original)
+++ cfe/branches/tooling/test/Modules/on-demand-build-warnings.m Fri Jan 20 10:14:22 2012
@@ -1,5 +1,5 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Wmodule-build -fmodule-cache-path %t -F %S/Inputs -verify %s
+// RUN: %clang_cc1 -fmodules -fno-objc-infer-related-result-type -Wmodule-build -fmodule-cache-path %t -F %S/Inputs -verify %s
 
-__import_module__ Module; // expected-warning{{building module 'Module' from source}}
+ at import Module; // expected-warning{{building module 'Module' from source}}
 

Modified: cfe/branches/tooling/test/Modules/on-demand-build.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/on-demand-build.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/on-demand-build.m (original)
+++ cfe/branches/tooling/test/Modules/on-demand-build.m Fri Jan 20 10:14:22 2012
@@ -1,13 +1,15 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -verify %s
-// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -x objective-c++ -fmodule-cache-path %t -F %S/Inputs -verify %s
-// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -verify %s
+// RUN: %clang_cc1 -fmodules -fno-objc-infer-related-result-type -Werror -Wno-error=incomplete-umbrella -fmodule-cache-path %t -F %S/Inputs -verify %s
+// RUN: %clang_cc1 -fmodules -fno-objc-infer-related-result-type -Werror -Wno-error=incomplete-umbrella -x objective-c++ -fmodule-cache-path %t -F %S/Inputs -verify %s
+// RUN: %clang_cc1 -fmodules -fno-objc-infer-related-result-type -Werror -Wno-error=incomplete-umbrella -fmodule-cache-path %t -F %S/Inputs -verify %s
 #define FOO
-__import_module__ Module;
+ at import Module;
 @interface OtherClass
 @end
 
 
+
+
 // in module: expected-note{{class method 'alloc' is assumed to return an instance of its receiver type ('Module *')}}
 void test_getModuleVersion() {
   const char *version = getModuleVersion();

Modified: cfe/branches/tooling/test/Modules/on-demand-macros.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/on-demand-macros.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/on-demand-macros.m (original)
+++ cfe/branches/tooling/test/Modules/on-demand-macros.m Fri Jan 20 10:14:22 2012
@@ -1,8 +1,8 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -DFOO_RETURNS_INT_PTR -verify %s
-// RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -verify %s
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -F %S/Inputs -DFOO_RETURNS_INT_PTR -verify %s
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -F %S/Inputs -verify %s
 
-__import_module__ CmdLine;
+ at import CmdLine;
 
 void test() {
 #ifdef FOO_RETURNS_INT_PTR

Modified: cfe/branches/tooling/test/Modules/redeclarations.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/redeclarations.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/redeclarations.m (original)
+++ cfe/branches/tooling/test/Modules/redeclarations.m Fri Jan 20 10:14:22 2012
@@ -1,11 +1,11 @@
-__import_module__ redeclarations_left;
-__import_module__ redeclarations_right;
+ at import redeclarations_left;
+ at import redeclarations_right;
 
 @interface MyObject : NSObject
 @end
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -emit-module -fmodule-name=redeclarations_left %S/Inputs/module.map
-// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -emit-module -fmodule-name=redeclarations_right %S/Inputs/module.map
-// RUN: %clang_cc1 -fmodule-cache-path %t %s -verify
+// RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -emit-module -fmodule-name=redeclarations_left %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -emit-module -fmodule-name=redeclarations_right %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t %s -verify
 

Modified: cfe/branches/tooling/test/Modules/subframeworks.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/subframeworks.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/subframeworks.m (original)
+++ cfe/branches/tooling/test/Modules/subframeworks.m Fri Jan 20 10:14:22 2012
@@ -1,16 +1,22 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify
+// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs -F %S/Inputs/DependsOnModule.framework/Frameworks %s -verify
+// RUN: %clang_cc1 -x objective-c++ -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs -F %S/Inputs/DependsOnModule.framework/Frameworks %s -verify
 
-__import_module__ DependsOnModule;
+ at import DependsOnModule;
 
 void testSubFramework() {
   float *sf1 = sub_framework; // expected-error{{use of undeclared identifier 'sub_framework'}}
 }
 
-__import_module__ DependsOnModule.SubFramework;
+ at import DependsOnModule.SubFramework;
 
 void testSubFrameworkAgain() {
   float *sf2 = sub_framework;
   double *sfo1 = sub_framework_other;
 }
 
+#ifdef __cplusplus
+ at import DependsOnModule.CXX;
+
+CXXOnly cxxonly;
+#endif

Modified: cfe/branches/tooling/test/Modules/submodules-preprocess.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/submodules-preprocess.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/submodules-preprocess.cpp (original)
+++ cfe/branches/tooling/test/Modules/submodules-preprocess.cpp Fri Jan 20 10:14:22 2012
@@ -1,7 +1,8 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -Eonly -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/submodules %s -verify
+// RUN: %clang_cc1 -fmodules -x objective-c++ -Eonly -fmodule-cache-path %t -I %S/Inputs/submodules %s -verify
+// FIXME: When we have a syntax for modules in C++, use that.
 
-__import_module__ std.vector;
+ at import std.vector;
 
 #ifndef HAVE_VECTOR
 #  error HAVE_VECTOR macro is not available (but should be)
@@ -15,7 +16,7 @@
 #  error HAVE_HASH_MAP macro is available (but shouldn't be)
 #endif
 
-__import_module__ std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
+ at import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
 
 #ifndef HAVE_VECTOR
 #  error HAVE_VECTOR macro is not available (but should be)
@@ -29,9 +30,9 @@
 #  error HAVE_HASH_MAP macro is available (but shouldn't be)
 #endif
 
-__import_module__ std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
+ at import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
 
-__import_module__ std; // import everything in 'std'
+ at import std; // import everything in 'std'
 
 #ifndef HAVE_VECTOR
 #  error HAVE_VECTOR macro is not available (but should be)
@@ -45,7 +46,7 @@
 #  error HAVE_HASH_MAP macro is available (but shouldn't be)
 #endif
 
-__import_module__ std.hash_map;
+ at import std.hash_map;
 
 #ifndef HAVE_VECTOR
 #  error HAVE_VECTOR macro is not available (but should be)

Modified: cfe/branches/tooling/test/Modules/submodules.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/submodules.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/submodules.cpp (original)
+++ cfe/branches/tooling/test/Modules/submodules.cpp Fri Jan 20 10:14:22 2012
@@ -1,7 +1,8 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/submodules %s -verify
+// RUN: %clang_cc1 -x objective-c++ -fmodule-cache-path %t -fmodules -I %S/Inputs/submodules %s -verify
+// FIXME: When we have a syntax for modules in C++, use that.
 
-__import_module__ std.vector;
+ at import std.vector;
 
 vector<int> vi;
 
@@ -9,20 +10,20 @@
 remove_reference<int&>::type *int_ptr = 0; // expected-error{{unknown type name 'remove_reference'}} \
 // expected-error{{expected unqualified-id}}
 
-__import_module__ std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
+ at import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
 
 vector<float> vf;
 remove_reference<int&>::type *int_ptr2 = 0;
 
-__import_module__ std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
+ at import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
 
-__import_module__ std; // import everything in 'std'
+ at import std; // import everything in 'std'
 
 // hash_map still isn't available.
 hash_map<int, float> ints_to_floats; // expected-error{{unknown type name 'hash_map'}} \
 // expected-error{{expected unqualified-id}}
 
-__import_module__ std.hash_map;
+ at import std.hash_map;
 
 hash_map<int, float> ints_to_floats2;
 

Modified: cfe/branches/tooling/test/Modules/submodules.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/submodules.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/submodules.m (original)
+++ cfe/branches/tooling/test/Modules/submodules.m Fri Jan 20 10:14:22 2012
@@ -1,9 +1,9 @@
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify
+// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify
 
 // Note: transitively imports Module.Sub2.
-__import_module__ Module.Sub;
+ at import Module.Sub;
 
 int getValue() { 
   return *Module_Sub + *Module_Sub2;

Modified: cfe/branches/tooling/test/Modules/wildcard-submodule-exports.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Modules/wildcard-submodule-exports.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Modules/wildcard-submodule-exports.cpp (original)
+++ cfe/branches/tooling/test/Modules/wildcard-submodule-exports.cpp Fri Jan 20 10:14:22 2012
@@ -1,7 +1,8 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/wildcard-submodule-exports %s -verify
+// RUN: %clang_cc1 -x objective-c++ -fmodule-cache-path %t -fmodules -I %S/Inputs/wildcard-submodule-exports %s -verify
+// FIXME: When we have a syntax for modules in C++, use that.
 
-__import_module__ C.One;
+ at import C.One;
 
 void test_C_One() {
   int *A1_ptr = A1;
@@ -9,7 +10,7 @@
   (void)B1; // expected-error{{use of undeclared identifier 'B1'}}
 }
 
-__import_module__ C.Two;
+ at import C.Two;
 
 void test_C_Two() {
   unsigned int *A2_ptr = A2;
@@ -17,7 +18,7 @@
   unsigned long *C2_ptr = C2;
 }
 
-__import_module__ B.One;
+ at import B.One;
 
 void test_B_One() {
   short *B1_ptr = B1;

Modified: cfe/branches/tooling/test/PCH/Inputs/arc.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/PCH/Inputs/arc.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/PCH/Inputs/arc.h (original)
+++ cfe/branches/tooling/test/PCH/Inputs/arc.h Fri Jan 20 10:14:22 2012
@@ -14,7 +14,13 @@
 id CreateSomething();
 NSString *CreateNSString();
 
-typedef int array0[sizeof((__bridge id)CFCreateSomething())];
-typedef int array1[sizeof((__bridge CFTypeRef)CreateSomething())];
+#if __has_feature(objc_arc)
+#define BRIDGE __bridge
+#else
+#define BRIDGE
+#endif
+
+typedef int array0[sizeof((BRIDGE id)CFCreateSomething())];
+typedef int array1[sizeof((BRIDGE CFTypeRef)CreateSomething())];
 
 

Modified: cfe/branches/tooling/test/PCH/chain-cxx.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/PCH/chain-cxx.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/PCH/chain-cxx.cpp (original)
+++ cfe/branches/tooling/test/PCH/chain-cxx.cpp Fri Jan 20 10:14:22 2012
@@ -38,12 +38,17 @@
 template <typename T>
 struct TS3 {
   static const int value = 0;
+  static const int value2;
 };
 template <typename T>
 const int TS3<T>::value;
+template <typename T>
+const int TS3<T>::value2 = 1;
 // Instantiate struct, but not value.
 struct instantiate : TS3<int> {};
 
+// Typedef
+typedef int Integer;
 
 //===----------------------------------------------------------------------===//
 #elif not defined(HEADER2)
@@ -94,8 +99,12 @@
 struct A { };
 struct B : A { };
 
-// Instantiate TS3's member.
+// Instantiate TS3's members.
 static const int ts3m1 = TS3<int>::value;
+extern int arr[TS3<int>::value2];
+
+// Redefinition of typedef
+typedef int Integer;
 
 //===----------------------------------------------------------------------===//
 #else
@@ -122,10 +131,12 @@
   TS2int ts2;
 
   B b;
+  Integer i = 17;
 }
 
 // Should have remembered that there is a definition.
 static const int ts3m2 = TS3<int>::value;
+int arr[TS3<int>::value2];
 
 //===----------------------------------------------------------------------===//
 #endif

Modified: cfe/branches/tooling/test/PCH/single-token-macro.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/PCH/single-token-macro.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/PCH/single-token-macro.c (original)
+++ cfe/branches/tooling/test/PCH/single-token-macro.c Fri Jan 20 10:14:22 2012
@@ -10,8 +10,6 @@
 #ifndef HEADER
 #define HEADER
 
-#define SKATA
-
 #define __stdcall
 #define STDCALL __stdcall
 

Modified: cfe/branches/tooling/test/Parser/cxx-ext-delete-default.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/cxx-ext-delete-default.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/cxx-ext-delete-default.cpp (original)
+++ cfe/branches/tooling/test/Parser/cxx-ext-delete-default.cpp Fri Jan 20 10:14:22 2012
@@ -1,11 +1,11 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
 
 struct A {
-  A(const A&) = delete; // expected-warning {{accepted as a C++11 extension}}
-  A& operator=(const A&) = delete; // expected-warning {{accepted as a C++11 extension}}
-  A() = default; // expected-warning {{accepted as a C++11 extension}}
+  A(const A&) = delete; // expected-warning {{C++11 extension}}
+  A& operator=(const A&) = delete; // expected-warning {{C++11 extension}}
+  A() = default; // expected-warning {{C++11 extension}}
   ~A();
 };
 
-void f() = delete; // expected-warning {{accepted as a C++11 extension}}
-A::~A() = default; //expected-warning {{accepted as a C++11 extension}}
+void f() = delete; // expected-warning {{C++11 extension}}
+A::~A() = default; //expected-warning {{C++11 extension}}

Modified: cfe/branches/tooling/test/Parser/cxx0x-attributes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/cxx0x-attributes.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/cxx0x-attributes.cpp (original)
+++ cfe/branches/tooling/test/Parser/cxx0x-attributes.cpp Fri Jan 20 10:14:22 2012
@@ -20,7 +20,7 @@
 unsigned [[]] int attr_in_decl_spec; // expected-error {{expected unqualified-id}}
 int & [[]] ref_attr = after_attr; // expected-error {{an attribute list cannot appear here}}
 class foo {
-  void after_const_attr () const [[]]; // expected-error {{expected body of lambda expression}} expected-error {{array has incomplete element type 'void'}}
+  void after_const_attr () const [[]]; // expected-error {{expected body of lambda expression}}
 };
 extern "C++" [[]] { } // expected-error {{an attribute list cannot appear here}}
 [[]] template <typename T> void before_template_attr (); // expected-error {{an attribute list cannot appear here}}

Modified: cfe/branches/tooling/test/Parser/cxx0x-in-cxx98.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/cxx0x-in-cxx98.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/cxx0x-in-cxx98.cpp (original)
+++ cfe/branches/tooling/test/Parser/cxx0x-in-cxx98.cpp Fri Jan 20 10:14:22 2012
@@ -12,9 +12,9 @@
   virtual void f();
   virtual void g();
 };
-struct D final : B { // expected-warning {{'final' keyword accepted as a C++11 extension}}
-  virtual void f() override; // expected-warning {{'override' keyword accepted as a C++11 extension}}
-  virtual void g() final; // expected-warning {{'final' keyword accepted as a C++11 extension}}
+struct D final : B { // expected-warning {{'final' keyword is a C++11 extension}}
+  virtual void f() override; // expected-warning {{'override' keyword is a C++11 extension}}
+  virtual void g() final; // expected-warning {{'final' keyword is a C++11 extension}}
 };
 
 void NewBracedInitList() {

Modified: cfe/branches/tooling/test/Parser/cxx0x-lambda-expressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/cxx0x-lambda-expressions.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/cxx0x-lambda-expressions.cpp (original)
+++ cfe/branches/tooling/test/Parser/cxx0x-lambda-expressions.cpp Fri Jan 20 10:14:22 2012
@@ -12,13 +12,13 @@
     [&this] {}; // expected-error {{'this' cannot be captured by reference}}
     [&,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
     [=,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
-    [] {};
-    [=] (int i) {};
-    [&] (int) mutable -> void {};
-    [foo,bar] () { return 3; };
-    [=,&foo] () {};
-    [&,foo] () {};
-    [this] () {};
+    [] {}; // expected-error {{lambda expressions are not supported yet}}
+    [=] (int i) {}; // expected-error {{lambda expressions are not supported yet}}
+    [&] (int) mutable -> void {}; // expected-error {{lambda expressions are not supported yet}}
+    [foo,bar] () { return 3; }; // expected-error {{lambda expressions are not supported yet}}
+    [=,&foo] () {}; // expected-error {{lambda expressions are not supported yet}}
+    [&,foo] () {}; // expected-error {{lambda expressions are not supported yet}}
+    [this] () {}; // expected-error {{lambda expressions are not supported yet}}
 
     return 1;
   }

Modified: cfe/branches/tooling/test/Parser/objc-quirks.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/objc-quirks.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/objc-quirks.m (original)
+++ cfe/branches/tooling/test/Parser/objc-quirks.m Fri Jan 20 10:14:22 2012
@@ -7,7 +7,7 @@
 // rdar://6480479
 @interface A // expected-note {{class started here}}
 }; // expected-error {{missing '@end'}} \
-// expected-error {{expected external declaration}} \
+// expected-error {{extraneous closing brace ('}')}} \
 // expected-warning{{extra ';' outside of a function}}
 
 

Modified: cfe/branches/tooling/test/Parser/objcxx0x-lambda-expressions.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/objcxx0x-lambda-expressions.mm?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/objcxx0x-lambda-expressions.mm (original)
+++ cfe/branches/tooling/test/Parser/objcxx0x-lambda-expressions.mm Fri Jan 20 10:14:22 2012
@@ -11,15 +11,13 @@
     []; // expected-error {{expected body of lambda expression}}
     [=,foo+] {}; // expected-error {{expected ',' or ']' in lambda capture list}}
     [&this] {}; // expected-error {{address expression must be an lvalue}}
-    [] {};
-    [=] (int i) {};
-    [&] (int) mutable -> void {};
-    // FIXME: this error occurs because we do not yet handle lambda scopes
-    // properly. I did not anticipate it because I thought it was a semantic (not
-    // syntactic) check.
-    [foo,bar] () { return 3; }; // expected-error {{void function 'f' should not return a value}}
-    [=,&foo] () {};
-    [this] () {};
+    [] {}; // expected-error {{lambda expressions are not supported yet}}
+    [=] (int i) {}; // expected-error {{lambda expressions are not supported yet}}
+    [&] (int) mutable -> void {}; // expected-error {{lambda expressions are not supported yet}}
+    // FIXME: Implicit return type deduction doesn't work yet.
+    [foo,bar] () { return 3; }; // expected-error {{void function 'f' should not return a value}} expected-error {{lambda expressions are not supported yet}}
+    [=,&foo] () {}; // expected-error {{lambda expressions are not supported yet}}
+    [this] () {}; // expected-error {{lambda expressions are not supported yet}}
   }
 
 };

Modified: cfe/branches/tooling/test/Parser/recovery.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/recovery.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/recovery.c (original)
+++ cfe/branches/tooling/test/Parser/recovery.c Fri Jan 20 10:14:22 2012
@@ -16,7 +16,7 @@
 
 
 // PR3172
-} // expected-error {{expected external declaration}}
+} // expected-error {{extraneous closing brace ('}')}}
 
 
 // rdar://6094870

Modified: cfe/branches/tooling/test/Preprocessor/init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Preprocessor/init.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Preprocessor/init.c (original)
+++ cfe/branches/tooling/test/Preprocessor/init.c Fri Jan 20 10:14:22 2012
@@ -242,7 +242,7 @@
 // I386:#define __FLT_DENORM_MIN__ 1.40129846e-45F
 // I386:#define __FLT_DIG__ 6
 // I386:#define __FLT_EPSILON__ 1.19209290e-7F
-// I386:#define __FLT_EVAL_METHOD__ 0
+// I386:#define __FLT_EVAL_METHOD__ 2
 // I386:#define __FLT_HAS_DENORM__ 1
 // I386:#define __FLT_HAS_INFINITY__ 1
 // I386:#define __FLT_HAS_QUIET_NAN__ 1
@@ -315,7 +315,7 @@
 // I386:#define __i386__ 1
 // I386:#define i386 1
 //
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-pc-linux-gnu < /dev/null | FileCheck -check-prefix I386-LINUX %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-pc-linux-gnu -target-cpu pentium4 < /dev/null | FileCheck -check-prefix I386-LINUX %s
 //
 // I386-LINUX:#define __CHAR16_TYPE__ unsigned short
 // I386-LINUX:#define __CHAR32_TYPE__ unsigned int

Modified: cfe/branches/tooling/test/Preprocessor/line-directive.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Preprocessor/line-directive.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Preprocessor/line-directive.c (original)
+++ cfe/branches/tooling/test/Preprocessor/line-directive.c Fri Jan 20 10:14:22 2012
@@ -41,7 +41,7 @@
 
 # 192 "glomp.h" // not a system header.
 typedef int x;  // expected-note {{previous definition is here}}
-typedef int x;  // expected-error {{redefinition of typedef 'x' is invalid in C}}
+typedef int x;  // expected-warning {{redefinition of typedef 'x' is a C11 feature}}
 
 # 192 "glomp.h" 3 // System header.
 typedef int y;  // ok
@@ -62,7 +62,7 @@
 # 42 "blonk.h"  // DOES change system headerness.
 
 typedef int w;  // expected-note {{previous definition is here}}
-typedef int w;  // expected-error {{redefinition of typedef 'w' is invalid in C}}
+typedef int w;  // expected-warning {{redefinition of typedef 'w' is a C11 feature}}
 
 typedef int q;  // original definition in system header, should not diagnose.
 

Modified: cfe/branches/tooling/test/Preprocessor/predefined-macros.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Preprocessor/predefined-macros.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Preprocessor/predefined-macros.c (original)
+++ cfe/branches/tooling/test/Preprocessor/predefined-macros.c Fri Jan 20 10:14:22 2012
@@ -1,12 +1,14 @@
-// This test verifies that the correct macros are predefined. It currently
-// only checks for Microsoft macros.
-
-// RUN: %clang_cc1 %s -E -dM -triple i686-pc-win32 -fms-extensions -fmsc-version=1300 -o - | FileCheck %s
-
-
-// CHECK: #define _INTEGRAL_MAX_BITS 64
-// CHECK: #define _MSC_EXTENSIONS 1
-// CHECK: #define _MSC_VER 1300
-// CHECK: #define _M_IX86 600
-// CHECK: #define _M_IX86_FP
-// CHECK: #define _WIN32 1
+// This test verifies that the correct macros are predefined.
+//
+// RUN: %clang_cc1 %s -E -dM -triple i686-pc-win32 -fms-extensions \
+// RUN:     -fmsc-version=1300 -o - | FileCheck %s --check-prefix=CHECK-MS
+// CHECK-MS: #define _INTEGRAL_MAX_BITS 64
+// CHECK-MS: #define _MSC_EXTENSIONS 1
+// CHECK-MS: #define _MSC_VER 1300
+// CHECK-MS: #define _M_IX86 600
+// CHECK-MS: #define _M_IX86_FP
+// CHECK-MS: #define _WIN32 1
+//
+// RUN: %clang_cc1 %s -E -dM -ffast-math -o - \
+// RUN:   | FileCheck %s --check-prefix=CHECK-FAST-MATH
+// CHECK-FAST-MATH: #define __FAST_MATH__

Modified: cfe/branches/tooling/test/Rewriter/rewrite-implementation.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Rewriter/rewrite-implementation.mm?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Rewriter/rewrite-implementation.mm (original)
+++ cfe/branches/tooling/test/Rewriter/rewrite-implementation.mm Fri Jan 20 10:14:22 2012
@@ -11,3 +11,6 @@
 @implementation b
 @end
 
+ at interface NSArray @end
+ at class NSArray;
+ at implementation NSArray @end

Modified: cfe/branches/tooling/test/Rewriter/rewrite-super-message.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Rewriter/rewrite-super-message.mm?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Rewriter/rewrite-super-message.mm (original)
+++ cfe/branches/tooling/test/Rewriter/rewrite-super-message.mm Fri Jan 20 10:14:22 2012
@@ -18,3 +18,34 @@
 @end
 
 // CHECK: call %struct.objc_class* @class_getSuperclass
+
+ at class NSZone;
+
+ at interface NSObject {
+}
+
++ (id)allocWithZone:(NSZone *)zone;
+ at end
+
+
+ at interface NSArray : NSObject
+ at end
+
+ at implementation NSArray
++ (id)allocWithZone:(NSZone *)zone {
+    return [super allocWithZone:zone];
+}
+ at end
+
+ at interface XNSArray
+{
+  Class isa;
+}
+ at end
+
+ at class XNSArray;
+
+ at interface __NSArray0 : XNSArray
+ at end
+
+ at implementation __NSArray0 @end

Modified: cfe/branches/tooling/test/Sema/PR2963-enum-constant.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/PR2963-enum-constant.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/PR2963-enum-constant.c (original)
+++ cfe/branches/tooling/test/Sema/PR2963-enum-constant.c Fri Jan 20 10:14:22 2012
@@ -13,5 +13,5 @@
 
 enum
 {
-        SOME_VALUE= FLOAT_TO_SHORT_FIXED(0.1) // expected-warning{{expression is not integer constant expression}}
+        SOME_VALUE= FLOAT_TO_SHORT_FIXED(0.1) // expected-warning{{expression is not an integer constant expression}}
 };

Modified: cfe/branches/tooling/test/Sema/array-init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/array-init.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/array-init.c (original)
+++ cfe/branches/tooling/test/Sema/array-init.c Fri Jan 20 10:14:22 2012
@@ -167,7 +167,7 @@
 
 void variableArrayInit() {
   int a = 4;
-  char strlit[a] = "foo"; //expected-error{{array initializer must be an initializer list or string literal}}
+  char strlit[a] = "foo"; //expected-error{{variable-sized object may not be initialized}}
   int b[a] = { 1, 2, 4 }; //expected-error{{variable-sized object may not be initialized}}
 }
 
@@ -218,7 +218,7 @@
 }
 
 // PR2151
-void emptyInit() {struct {} x[] = {6};} //expected-warning{{empty struct (accepted as an extension) has size 0 in C, size 1 in C++}} \
+void emptyInit() {struct {} x[] = {6};} //expected-warning{{empty struct is a GNU extension}} \
 // expected-error{{initializer for aggregate with no elements}}
 
 void noNamedInit() {
@@ -242,7 +242,7 @@
 };
 
 static void sppp_ipv6cp_up();
-const struct {} ipcp = { sppp_ipv6cp_up }; //expected-warning{{empty struct (accepted as an extension) has size 0 in C, size 1 in C++}} \
+const struct {} ipcp = { sppp_ipv6cp_up }; //expected-warning{{empty struct is a GNU extension}} \
 // expected-warning{{excess elements in struct initializer}}
 
 struct _Matrix { union { float m[4][4]; }; }; //expected-warning{{anonymous unions are a GNU extension in C}}
@@ -278,3 +278,10 @@
 
 int nonconst_value();
 int a7[5] = (int[5]){ 1, 2, 3, 4, nonconst_value() }; // expected-error{{initializer element is not a compile-time constant}}
+
+// <rdar://problem/10636946>
+__attribute__((weak)) const unsigned int test10_bound = 10;
+char test10_global[test10_bound]; // expected-error {{variable length array declaration not allowed at file scope}}
+void test10() {
+  char test10_local[test10_bound] = "help"; // expected-error {{variable-sized object may not be initialized}}
+}

Modified: cfe/branches/tooling/test/Sema/attr-declspec-ignored.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/attr-declspec-ignored.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/attr-declspec-ignored.c (original)
+++ cfe/branches/tooling/test/Sema/attr-declspec-ignored.c Fri Jan 20 10:14:22 2012
@@ -1,12 +1,12 @@
-// RUN: %clang_cc1 %s -verify -fsyntax-only
-
-__attribute__((visibility("hidden")))  __attribute__((aligned)) struct A; // expected-warning{{attribute 'visibility' is ignored, place it after "struct" to apply attribute to type declaration}} \
-// expected-warning{{attribute 'aligned' is ignored, place it after "struct" to apply attribute to type declaration}}
-__attribute__((visibility("hidden")))  __attribute__((aligned)) union B; // expected-warning{{attribute 'visibility' is ignored, place it after "union" to apply attribute to type declaration}} \
-// expected-warning{{attribute 'aligned' is ignored, place it after "union" to apply attribute to type declaration}} 
-__attribute__((visibility("hidden")))  __attribute__((aligned)) enum C {C}; // expected-warning{{attribute 'visibility' is ignored, place it after "enum" to apply attribute to type declaration}} \
-// expected-warning{{attribute 'aligned' is ignored, place it after "enum" to apply attribute to type declaration}}
-
-__attribute__((visibility("hidden")))  __attribute__((aligned)) struct D {} d;
-__attribute__((visibility("hidden")))  __attribute__((aligned)) union E {} e;
-__attribute__((visibility("hidden")))  __attribute__((aligned)) enum F {F} f;
+// RUN: %clang_cc1 %s -verify -fsyntax-only
+
+__attribute__((visibility("hidden")))  __attribute__((aligned)) struct A; // expected-warning{{attribute 'visibility' is ignored, place it after "struct" to apply attribute to type declaration}} \
+// expected-warning{{attribute 'aligned' is ignored, place it after "struct" to apply attribute to type declaration}}
+__attribute__((visibility("hidden")))  __attribute__((aligned)) union B; // expected-warning{{attribute 'visibility' is ignored, place it after "union" to apply attribute to type declaration}} \
+// expected-warning{{attribute 'aligned' is ignored, place it after "union" to apply attribute to type declaration}} 
+__attribute__((visibility("hidden")))  __attribute__((aligned)) enum C {C}; // expected-warning{{attribute 'visibility' is ignored, place it after "enum" to apply attribute to type declaration}} \
+// expected-warning{{attribute 'aligned' is ignored, place it after "enum" to apply attribute to type declaration}}
+
+__attribute__((visibility("hidden")))  __attribute__((aligned)) struct D {} d;
+__attribute__((visibility("hidden")))  __attribute__((aligned)) union E {} e;
+__attribute__((visibility("hidden")))  __attribute__((aligned)) enum F {F} f;

Modified: cfe/branches/tooling/test/Sema/block-sentinel-attribute.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/block-sentinel-attribute.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/block-sentinel-attribute.c (original)
+++ cfe/branches/tooling/test/Sema/block-sentinel-attribute.c Fri Jan 20 10:14:22 2012
@@ -3,7 +3,8 @@
 void (^e) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (1,1)));
 
 int main() {
-  void (^bbad) (int arg, const char * format) __attribute__ ((__sentinel__)) ; // expected-warning {{sentinel' attribute only supported for variadic blocks}}
+  void (^bbad) (int arg, const char * format) __attribute__ ((__sentinel__)) ; // expected-warning {{'sentinel' attribute only supported for variadic blocks}}
+  bbad = ^void (int arg, const char * format) __attribute__ ((__sentinel__)) {} ; // expected-warning {{'sentinel' attribute only supported for variadic blocks}}
   void (^b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)) =  // expected-note {{block has been explicitly marked sentinel here}}
     ^ __attribute__ ((__sentinel__)) (int arg, const char * format, ...) {};
   void (^z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))) = ^ __attribute__ ((__sentinel__ (2))) (int arg, const char * format, ...) {}; // expected-note {{block has been explicitly marked sentinel here}}

Modified: cfe/branches/tooling/test/Sema/c89.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/c89.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/c89.c (original)
+++ cfe/branches/tooling/test/Sema/c89.c Fri Jan 20 10:14:22 2012
@@ -61,11 +61,11 @@
 void foo(void) {}
 
 /* PR2759 */
-void test10 (int x[*]); /* expected-warning {{variable length arrays are a C99 feature, accepted as an extension}} */
-void test11 (int x[static 4]); /* expected-warning {{use of C99-specific array features}} */
+void test10 (int x[*]); /* expected-warning {{variable length arrays are a C99 feature}} */
+void test11 (int x[static 4]); /* expected-warning {{static array size is a C99 feature}} */
 
-void test12 (int x[const 4]) { /* expected-warning {{use of C99-specific array features}} */
-  int Y[x[1]]; /* expected-warning {{variable length arrays are a C99 feature, accepted as an extension}} */
+void test12 (int x[const 4]) { /* expected-warning {{qualifier in array size is a C99 feature}} */
+  int Y[x[1]]; /* expected-warning {{variable length arrays are a C99 feature}} */
 }
 
 /* PR4074 */

Modified: cfe/branches/tooling/test/Sema/complex-init-list.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/complex-init-list.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/complex-init-list.c (original)
+++ cfe/branches/tooling/test/Sema/complex-init-list.c Fri Jan 20 10:14:22 2012
@@ -43,3 +43,6 @@
 _Complex float sizecheck1[(sizeof(sizetest1) == sizeof(*sizetest1)*2) ? 1 : -1];
 _Complex float sizetest2[] = { 1.0f, 1.0f, {1.0f, 1.0f} };  // expected-warning {{specifying real and imaginary components is an extension}}
 _Complex float sizecheck2[(sizeof(sizetest2) == sizeof(*sizetest2)*3) ? 1 : -1];
+
+// Constant-folding with init list.
+_Complex float x = 2 + (_Complex float) { 1, 2 };  // expected-warning {{specifying real and imaginary components is an extension}}

Modified: cfe/branches/tooling/test/Sema/compound-literal.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/compound-literal.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/compound-literal.c (original)
+++ cfe/branches/tooling/test/Sema/compound-literal.c Fri Jan 20 10:14:22 2012
@@ -12,7 +12,7 @@
 static int *p2 = (int []){2,x}; // -expected-error {{initializer element is not a compile-time constant}}
 static long *p3 = (long []){2,"x"}; // -expected-warning {{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [2]'}}
 
-typedef struct { } cache_t; // -expected-warning{{empty struct (accepted as an extension) has size 0 in C, size 1 in C++}}
+typedef struct { } cache_t; // -expected-warning{{empty struct is a GNU extension}}
 static cache_t clo_I1_cache = ((cache_t) { } ); // -expected-warning{{use of GNU empty initializer extension}}
 
 typedef struct Test {int a;int b;} Test;

Modified: cfe/branches/tooling/test/Sema/format-strings-c90.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/format-strings-c90.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/format-strings-c90.c (original)
+++ cfe/branches/tooling/test/Sema/format-strings-c90.c Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-/* RUN: %clang_cc1 -fsyntax-only -verify -pedantic -std=c89 %s
+/* RUN: %clang_cc1 -fsyntax-only -verify -triple i386-apple-darwin9 -pedantic -std=c89 %s
  */
 
 int scanf(const char * restrict, ...);
@@ -7,6 +7,7 @@
 void foo(char **sp, float *fp, int *ip) {
   /* TODO: Warn that the 'a' length modifier is an extension. */
   scanf("%as", sp);
+  scanf("%a[abc]", sp);
 
   /* TODO: Warn that the 'a' conversion specifier is a C99 feature. */
   scanf("%a", fp);
@@ -18,4 +19,9 @@
   printf("%afoo", 1.0);
 
   scanf("%da", ip);
+
+  /* Test argument type check for the 'a' length modifier. */
+  scanf("%as", fp); /* expected-warning{{conversion specifies type 'char **' but the argument has type 'float *'}} */
+  scanf("%aS", fp); /* expected-warning{{conversion specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}} */
+  scanf("%a[abc]", fp); /* expected-warning{{conversion specifies type 'char **' but the argument has type 'float *'}} */
 }

Modified: cfe/branches/tooling/test/Sema/format-strings-scanf.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/format-strings-scanf.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/format-strings-scanf.c (original)
+++ cfe/branches/tooling/test/Sema/format-strings-scanf.c Fri Jan 20 10:14:22 2012
@@ -1,4 +1,7 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wformat-nonliteral %s
+// RUN: %clang_cc1 -fsyntax-only -verify -triple i386-apple-darwin9 -Wformat-nonliteral %s
+
+// Test that -Wformat=0 works:
+// RUN: %clang_cc1 -fsyntax-only -Werror -Wformat=0 %s
 
 #include <stdarg.h>
 typedef __typeof(sizeof(int)) size_t;
@@ -68,11 +71,32 @@
   vsscanf(buf, "%[abc", ap); // expected-warning{{no closing ']' for '%[' in scanf format string}}
 }
 
-void test_alloc_extension(char **sp, wchar_t **lsp) {
+void test_scanlist(int *ip, char *sp) {
+  scanf("%[abc]", ip); // expected-warning{{conversion specifies type 'char *' but the argument has type 'int *'}}
+  scanf("%h[abc]", sp); // expected-warning{{length modifier 'h' results in undefined behavior or no effect with '[' conversion specifier}}
+}
+
+void test_alloc_extension(char **sp, wchar_t **lsp, float *fp) {
   /* Make sure "%a" gets parsed as a conversion specifier for float,
    * even when followed by an 's', 'S' or '[', which would cause it to be
    * parsed as a length modifier in C90. */
   scanf("%as", sp); // expected-warning{{conversion specifies type 'float *' but the argument has type 'char **'}}
   scanf("%aS", lsp); // expected-warning{{conversion specifies type 'float *' but the argument has type 'wchar_t **'}}
   scanf("%a[bcd]", sp); // expected-warning{{conversion specifies type 'float *' but the argument has type 'char **'}}
+
+  // Test that the 'm' length modifier is only allowed with s, S, c, C or [.
+  // TODO: Warn that 'm' is an extension.
+  scanf("%ms", sp); // No warning.
+  scanf("%mS", lsp); // No warning.
+  scanf("%mc", sp); // No warning.
+  scanf("%mC", lsp); // No warning.
+  scanf("%m[abc]", sp); // No warning.
+  scanf("%md", sp); // expected-warning{{length modifier 'm' results in undefined behavior or no effect with 'd' conversion specifier}}
+
+  // Test argument type check for the 'm' length modifier.
+  scanf("%ms", fp); // expected-warning{{conversion specifies type 'char **' but the argument has type 'float *'}}
+  scanf("%mS", fp); // expected-warning{{conversion specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}}
+  scanf("%mc", fp); // expected-warning{{conversion specifies type 'char **' but the argument has type 'float *'}}
+  scanf("%mC", fp); // expected-warning{{conversion specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}}
+  scanf("%m[abc]", fp); // expected-warning{{conversion specifies type 'char **' but the argument has type 'float *'}}
 }

Modified: cfe/branches/tooling/test/Sema/function.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/function.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/function.c (original)
+++ cfe/branches/tooling/test/Sema/function.c Fri Jan 20 10:14:22 2012
@@ -89,3 +89,6 @@
 
 // missing ',' before '...'
 void t20(int i...) { } // expected-error {{requires a comma}}
+
+int n;
+void t21(int n, int (*array)[n]);

Modified: cfe/branches/tooling/test/Sema/implicit-decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/implicit-decl.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/implicit-decl.c (original)
+++ cfe/branches/tooling/test/Sema/implicit-decl.c Fri Jan 20 10:14:22 2012
@@ -16,9 +16,17 @@
    printg("Hello, World!\n"); // expected-error{{implicit declaration of function 'printg' is invalid in C99}} \
                               // expected-note{{did you mean 'printf'?}}
 
-  __builtin_is_les(1, 3); // expected-error{{use of unknown builtin '__builtin_is_les'}} \
-                          // expected-note{did you mean '__builtin_is_less'?}}
+  __builtin_is_les(1, 3); // expected-error{{use of unknown builtin '__builtin_is_les'}}
 }
 Boolean _CFCalendarDecomposeAbsoluteTimeV(const char *componentDesc, int32_t **vector, int32_t count) { // expected-error{{conflicting types for '_CFCalendarDecomposeAbsoluteTimeV'}}
  return 0;
 }
+
+
+// Test the typo-correction callback in Sema::ImplicitlyDefineFunction
+extern int sformatf(char *str, __const char *__restrict __format, ...); // expected-note{{'sformatf' declared here}}
+void test_implicit() {
+  int formats = 0;
+  formatd("Hello, World!\n"); // expected-error{{implicit declaration of function 'formatd' is invalid in C99}} \
+                              // expected-note{{did you mean 'sformatf'?}}
+}

Modified: cfe/branches/tooling/test/Sema/static-init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/static-init.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/static-init.c (original)
+++ cfe/branches/tooling/test/Sema/static-init.c Fri Jan 20 10:14:22 2012
@@ -15,9 +15,10 @@
 };
 
 struct foo {
-  unsigned ptr;
+  short ptr;
 };
 
 union bar u[1];
-struct foo x = {(intptr_t) u}; // no-error
+struct foo x = {(intptr_t) u}; // expected-error {{initializer element is not a compile-time constant}}
 struct foo y = {(char) u}; // expected-error {{initializer element is not a compile-time constant}}
+intptr_t z = (intptr_t) u; // no-error

Modified: cfe/branches/tooling/test/Sema/warn-unreachable.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/warn-unreachable.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/warn-unreachable.c (original)
+++ cfe/branches/tooling/test/Sema/warn-unreachable.c Fri Jan 20 10:14:22 2012
@@ -125,4 +125,10 @@
   return; // no-warning
 }
 
+// Test case for PR 9774.  Tests that dead code in macros aren't warned about.
+#define MY_MAX(a,b)     ((a) >= (b) ? (a) : (b))
+void PR9774(int *s) {
+    for (int i = 0; i < MY_MAX(2, 3); i++) // no-warning
+        s[i] = 0;
+}
 

Modified: cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/MicrosoftCompatibility.cpp Fri Jan 20 10:14:22 2012
@@ -84,7 +84,7 @@
 
 class C : public B { 
 private:   
-  using B::f; // expected-warning {{using declaration refers to inaccessible member 'ms_using_declaration_bug::B::f', which refers to accessible member 'ms_using_declaration_bug::A::f', accepted for Microsoft compatibility}}
+  using B::f; // expected-warning {{using declaration referring to inaccessible member 'ms_using_declaration_bug::B::f' (which refers to accessible member 'ms_using_declaration_bug::A::f') is a Microsoft compatibility extension}}
 };
 
 }

Modified: cfe/branches/tooling/test/SemaCXX/PR9572.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/PR9572.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/PR9572.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/PR9572.cpp Fri Jan 20 10:14:22 2012
@@ -3,7 +3,7 @@
   virtual ~Base(); // expected-note {{implicitly declared private here}}
 };
 struct Foo : public Base { // expected-error {{base class 'Base' has private destructor}}
-  const int kBlah = 3; // expected-warning {{accepted as a C++11 extension}}
+  const int kBlah = 3; // expected-warning {{is a C++11 extension}}
   Foo();
 };
 struct Bar : public Foo {

Modified: cfe/branches/tooling/test/SemaCXX/aggregate-initialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/aggregate-initialization.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/aggregate-initialization.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/aggregate-initialization.cpp Fri Jan 20 10:14:22 2012
@@ -1,33 +1,33 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s 
 
-// Verify that we can't initialize non-aggregates with an initializer
-// list.
+// Verify that using an initializer list for a non-aggregate looks for
+// constructors..
 // Note that due to a (likely) standard bug, this is technically an aggregate,
 // but we do not treat it as one.
-struct NonAggr1 {
-  NonAggr1(int) { }
+struct NonAggr1 { // expected-note 2 {{candidate constructor}}
+  NonAggr1(int, int) { } // expected-note {{candidate constructor}}
 
   int m;
 };
 
 struct Base { };
-struct NonAggr2 : public Base {
+struct NonAggr2 : public Base { // expected-note 3 {{candidate constructor}}
   int m;
 };
 
-class NonAggr3 {
+class NonAggr3 { // expected-note 3 {{candidate constructor}}
   int m;
 };
 
-struct NonAggr4 {
+struct NonAggr4 { // expected-note 3 {{candidate constructor}}
   int m;
   virtual void f();
 };
 
-NonAggr1 na1 = { 17 }; // expected-error{{non-aggregate type 'NonAggr1' cannot be initialized with an initializer list}}
-NonAggr2 na2 = { 17 }; // expected-error{{non-aggregate type 'NonAggr2' cannot be initialized with an initializer list}}
-NonAggr3 na3 = { 17 }; // expected-error{{non-aggregate type 'NonAggr3' cannot be initialized with an initializer list}}
-NonAggr4 na4 = { 17 }; // expected-error{{non-aggregate type 'NonAggr4' cannot be initialized with an initializer list}}
+NonAggr1 na1 = { 17 }; // expected-error{{no matching constructor for initialization of 'NonAggr1'}}
+NonAggr2 na2 = { 17 }; // expected-error{{no matching constructor for initialization of 'NonAggr2'}}
+NonAggr3 na3 = { 17 }; // expected-error{{no matching constructor for initialization of 'NonAggr3'}}
+NonAggr4 na4 = { 17 }; // expected-error{{no matching constructor for initialization of 'NonAggr4'}}
 
 // PR5817
 typedef int type[][2];

Modified: cfe/branches/tooling/test/SemaCXX/attr-declspec-ignored.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/attr-declspec-ignored.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/attr-declspec-ignored.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/attr-declspec-ignored.cpp Fri Jan 20 10:14:22 2012
@@ -1,19 +1,19 @@
-// RUN: %clang_cc1 %s -verify -fsyntax-only
-
-namespace test1 {
-  __attribute__((visibility("hidden")))  __attribute__((aligned)) class A; // expected-warning{{attribute 'visibility' is ignored, place it after "class" to apply attribute to type declaration}} \
-  // expected-warning{{attribute 'aligned' is ignored, place it after "class" to apply attribute to type declaration}}
-  __attribute__((visibility("hidden")))  __attribute__((aligned)) struct B; // expected-warning{{attribute 'visibility' is ignored, place it after "struct" to apply attribute to type declaration}} \
-  // expected-warning{{attribute 'aligned' is ignored, place it after "struct" to apply attribute to type declaration}}
-  __attribute__((visibility("hidden")))  __attribute__((aligned)) union C; // expected-warning{{attribute 'visibility' is ignored, place it after "union" to apply attribute to type declaration}} \
-  // expected-warning{{attribute 'aligned' is ignored, place it after "union" to apply attribute to type declaration}} 
-  __attribute__((visibility("hidden")))  __attribute__((aligned)) enum D {D}; // expected-warning{{attribute 'visibility' is ignored, place it after "enum" to apply attribute to type declaration}} \
-  // expected-warning{{attribute 'aligned' is ignored, place it after "enum" to apply attribute to type declaration}}
-}
-
-namespace test2 {
-  __attribute__((visibility("hidden")))  __attribute__((aligned)) class A {} a;
-  __attribute__((visibility("hidden")))  __attribute__((aligned)) struct B {} b;
-  __attribute__((visibility("hidden")))  __attribute__((aligned)) union C {} c;
-  __attribute__((visibility("hidden")))  __attribute__((aligned)) enum D {D} d;
-}
+// RUN: %clang_cc1 %s -verify -fsyntax-only
+
+namespace test1 {
+  __attribute__((visibility("hidden")))  __attribute__((aligned)) class A; // expected-warning{{attribute 'visibility' is ignored, place it after "class" to apply attribute to type declaration}} \
+  // expected-warning{{attribute 'aligned' is ignored, place it after "class" to apply attribute to type declaration}}
+  __attribute__((visibility("hidden")))  __attribute__((aligned)) struct B; // expected-warning{{attribute 'visibility' is ignored, place it after "struct" to apply attribute to type declaration}} \
+  // expected-warning{{attribute 'aligned' is ignored, place it after "struct" to apply attribute to type declaration}}
+  __attribute__((visibility("hidden")))  __attribute__((aligned)) union C; // expected-warning{{attribute 'visibility' is ignored, place it after "union" to apply attribute to type declaration}} \
+  // expected-warning{{attribute 'aligned' is ignored, place it after "union" to apply attribute to type declaration}} 
+  __attribute__((visibility("hidden")))  __attribute__((aligned)) enum D {D}; // expected-warning{{attribute 'visibility' is ignored, place it after "enum" to apply attribute to type declaration}} \
+  // expected-warning{{attribute 'aligned' is ignored, place it after "enum" to apply attribute to type declaration}}
+}
+
+namespace test2 {
+  __attribute__((visibility("hidden")))  __attribute__((aligned)) class A {} a;
+  __attribute__((visibility("hidden")))  __attribute__((aligned)) struct B {} b;
+  __attribute__((visibility("hidden")))  __attribute__((aligned)) union C {} c;
+  __attribute__((visibility("hidden")))  __attribute__((aligned)) enum D {D} d;
+}

Modified: cfe/branches/tooling/test/SemaCXX/c99-variable-length-array.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/c99-variable-length-array.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/c99-variable-length-array.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/c99-variable-length-array.cpp Fri Jan 20 10:14:22 2012
@@ -14,8 +14,8 @@
 
 // We allow VLAs of POD types, only.
 void vla(int N) {
-  int array1[N]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
-  POD array2[N]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+  int array1[N]; // expected-warning{{variable length arrays are a C99 feature}}
+  POD array2[N]; // expected-warning{{variable length arrays are a C99 feature}}
   NonPOD array3[N]; // expected-error{{variable length array of non-POD element type 'NonPOD'}}
   NonPOD2 array4[N][3]; // expected-error{{variable length array of non-POD element type 'NonPOD2'}}
 }
@@ -23,7 +23,7 @@
 /// Warn about VLAs in templates.
 template<typename T>
 void vla_in_template(int N, T t) {
-  int array1[N]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+  int array1[N]; // expected-warning{{variable length arrays are a C99 feature}}
 }
 
 struct HasConstantValue {
@@ -36,7 +36,7 @@
 
 template<typename T>
 void vla_in_template(T t) {
-  int array2[T::value]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+  int array2[T::value]; // expected-warning{{variable length arrays are a C99 feature}}
 }
 
 template void vla_in_template<HasConstantValue>(HasConstantValue);
@@ -47,14 +47,14 @@
 // Cannot use any variably-modified type with a template parameter or
 // argument.
 void inst_with_vla(int N) {
-  int array[N]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+  int array[N]; // expected-warning{{variable length arrays are a C99 feature}}
   X0<__typeof__(array)> x0a; // expected-error{{variably modified type 'typeof (array)' (aka 'int [N]') cannot be used as a template argument}}
 }
 
 template<typename T>
 struct X1 {
   template<int (&Array)[T::value]> // expected-error{{non-type template parameter of variably modified type 'int (&)[HasNonConstantValue::value]'}}  \
-  // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+  // expected-warning{{variable length arrays are a C99 feature}}
   struct Inner {
     
   };
@@ -68,7 +68,7 @@
 void accept_array(T (&array)[N]); // expected-note{{candidate template ignored: failed template argument deduction}}
 
 void test_accept_array(int N) {
-  int array[N]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+  int array[N]; // expected-warning{{variable length arrays are a C99 feature}}
   accept_array(array); // expected-error{{no matching function for call to 'accept_array'}}
 }
 
@@ -77,7 +77,7 @@
   struct X {
     int size;
     int array[N]; // expected-error{{fields must have a constant size: 'variable length array in structure' extension will never be supported}} \
-                  // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+                  // expected-warning{{variable length arrays are a C99 feature}}
   };
 }
 
@@ -87,7 +87,7 @@
       float left;
       float right;
     };
-    struct edge_info edgeInfo[x]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+    struct edge_info edgeInfo[x]; // expected-warning{{variable length arrays are a C99 feature}}
   }
 }
 
@@ -95,7 +95,7 @@
   template<typename T>
   void f(int i) {
     const unsigned value = i;
-    int array[value * i]; // expected-warning 2{{variable length arrays are a C99 feature, accepted as an extension}}
+    int array[value * i]; // expected-warning 2{{variable length arrays are a C99 feature}}
   }
 
   template void f<int>(int); // expected-note{{instantiation of}}
@@ -109,7 +109,7 @@
     typedef typename T::my_int my_int;
     void f0() {
       int M = 4;
-      my_int a[M]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+      my_int a[M]; // expected-warning{{variable length arrays are a C99 feature}}
     }
   };
   B<A> a;
@@ -117,7 +117,7 @@
 
 namespace PR8209 {
   void f(int n) {
-    typedef int vla_type[n]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+    typedef int vla_type[n]; // expected-warning{{variable length arrays are a C99 feature}}
     (void)new vla_type; // expected-error{{variably}}
   }
 }

Modified: cfe/branches/tooling/test/SemaCXX/c99.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/c99.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/c99.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/c99.cpp Fri Jan 20 10:14:22 2012
@@ -4,6 +4,6 @@
 
 struct Point { int x; int y; };
 
-Point p1 = { .x = 17, // expected-warning{{designated initializers are a C99 feature, accepted in C++ as an extension}} 
-             y: 25 }; // expected-warning{{designated initializers are a C99 feature, accepted in C++ as an extension}} \
+Point p1 = { .x = 17, // expected-warning{{designated initializers are a C99 feature}}
+             y: 25 }; // expected-warning{{designated initializers are a C99 feature}} \
                       // expected-warning{{use of GNU old-style field designator extension}}

Modified: cfe/branches/tooling/test/SemaCXX/class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/class.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/class.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/class.cpp Fri Jan 20 10:14:22 2012
@@ -34,10 +34,10 @@
 
   enum E1 { en1, en2 };
 
-  int i = 0; // expected-warning {{in-class initialization of non-static data member accepted as a C++11 extension}}
+  int i = 0; // expected-warning {{in-class initialization of non-static data member is a C++11 extension}}
   static int si = 0; // expected-error {{non-const static data member must be initialized out of line}}
   static const NestedC ci = 0; // expected-error {{static data member of type 'const C::NestedC' must be initialized out of line}}
-  static const int nci = vs; // expected-error {{in-class initializer is not a constant expression}}
+  static const int nci = vs; // expected-error {{in-class initializer for static data member is not a constant expression}}
   static const int vi = 0;
   static const volatile int cvi = 0; // ok, illegal in C++11
   static const E evi = 0;
@@ -174,7 +174,7 @@
 
   struct A {
     static const float x = 5.0f; // expected-warning {{in-class initializer for static data member of type 'const float' is a GNU extension}}
-    static const float y = foo(); // expected-warning {{in-class initializer for static data member of type 'const float' is a GNU extension}} expected-error {{in-class initializer is not a constant expression}}
+    static const float y = foo(); // expected-warning {{in-class initializer for static data member of type 'const float' is a GNU extension}} expected-error {{in-class initializer for static data member is not a constant expression}}
   };
 }
 

Modified: cfe/branches/tooling/test/SemaCXX/condition.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/condition.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/condition.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/condition.cpp Fri Jan 20 10:14:22 2012
@@ -7,7 +7,7 @@
 
   typedef int arr[10];
   while (arr x=0) ; // expected-error {{an array type is not allowed here}} expected-error {{array initializer must be an initializer list}}
-  while (int f()=0) ; // expected-error {{a function type is not allowed here}}
+  while (int f()=0) ; // expected-warning {{interpreted as a function declaration}} expected-note {{initializer}} expected-error {{a function type is not allowed here}}
 
   struct S {} s;
   if (s) ++x; // expected-error {{value of type 'struct S' is not contextually convertible to 'bool'}}

Modified: cfe/branches/tooling/test/SemaCXX/conditional-expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/conditional-expr.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/conditional-expr.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/conditional-expr.cpp Fri Jan 20 10:14:22 2012
@@ -96,8 +96,8 @@
   (void)(i1 ? BadDerived() : BadBase());
 
   // b2.1 (hierarchy stuff)
-  const Base constret();
-  const Derived constder();
+  extern const Base constret();
+  extern const Derived constder();
   // should use const overload
   A a1((i1 ? constret() : Base()).trick());
   A a2((i1 ? Base() : constret()).trick());

Modified: cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp Fri Jan 20 10:14:22 2012
@@ -8,18 +8,17 @@
 
 }
 
-// FIXME: support const T& parameters here.
-//template<typename T> constexpr T id(const T &t) { return t; }
-template<typename T> constexpr T id(T t) { return t; } // expected-note {{here}}
-// FIXME: support templates here.
-//template<typename T> constexpr T min(const T &a, const T &b) {
-//  return a < b ? a : b;
-//}
-//template<typename T> constexpr T max(const T &a, const T &b) {
-//  return a < b ? b : a;
-//}
-constexpr int min(const int &a, const int &b) { return a < b ? a : b; }
-constexpr int max(const int &a, const int &b) { return a < b ? b : a; }
+typedef decltype(sizeof(char)) size_t;
+
+template<typename T> constexpr T id(const T &t) { return t; }
+template<typename T> constexpr T min(const T &a, const T &b) {
+  return a < b ? a : b;
+}
+template<typename T> constexpr T max(const T &a, const T &b) {
+  return a < b ? b : a;
+}
+template<typename T, size_t N> constexpr T *begin(T (&xs)[N]) { return xs; }
+template<typename T, size_t N> constexpr T *end(T (&xs)[N]) { return xs + N; }
 
 struct MemberZero {
   constexpr int zero() { return 0; }
@@ -86,26 +85,29 @@
   template<int n> struct IntParam {};
 
   using IntParam0 = IntParam<0>;
-  // FIXME: This should be accepted once we implement the new ICE rules.
-  using IntParam0 = IntParam<id(0)>; // expected-error {{not an integral constant expression}}
-  using IntParam0 = IntParam<MemberZero().zero>; // expected-error {{did you mean to call it with no arguments?}} expected-error {{not an integral constant expression}}
+  using IntParam0 = IntParam<id(0)>;
+  using IntParam0 = IntParam<MemberZero().zero>; // expected-error {{did you mean to call it with no arguments?}}
 }
 
 namespace CaseStatements {
   void f(int n) {
     switch (n) {
-    // FIXME: Produce the 'add ()' fixit for this.
-    case MemberZero().zero: // desired-error {{did you mean to call it with no arguments?}} expected-error {{not an integer constant expression}} expected-note {{non-literal type '<bound member function type>'}}
-    // FIXME: This should be accepted once we implement the new ICE rules.
-    case id(1): // expected-error {{not an integer constant expression}} expected-note {{undefined function}}
+    case MemberZero().zero: // expected-error {{did you mean to call it with no arguments?}} expected-note {{previous}}
+    case id(0): // expected-error {{duplicate case value '0'}}
       return;
     }
   }
 }
 
 extern int &Recurse1;
-int &Recurse2 = Recurse1, &Recurse1 = Recurse2;
-constexpr int &Recurse3 = Recurse2; // expected-error {{must be initialized by a constant expression}}
+int &Recurse2 = Recurse1; // expected-note 2{{declared here}} expected-note {{initializer of 'Recurse1' is not a constant expression}}
+int &Recurse1 = Recurse2; // expected-note {{declared here}} expected-note {{initializer of 'Recurse2' is not a constant expression}}
+constexpr int &Recurse3 = Recurse2; // expected-error {{must be initialized by a constant expression}} expected-note {{initializer of 'Recurse2' is not a constant expression}}
+
+extern const int RecurseA;
+const int RecurseB = RecurseA; // expected-note {{declared here}}
+const int RecurseA = 10;
+constexpr int RecurseC = RecurseB; // expected-error {{must be initialized by a constant expression}} expected-note {{initializer of 'RecurseB' is not a constant expression}}
 
 namespace MemberEnum {
   struct WithMemberEnum {
@@ -140,8 +142,8 @@
 static_assert(F(1, 0) == 1, "");
 static_assert(F(2, "test") == 2, "");
 static_assert(F(3, &F) == 3, "");
-int k = 0;
-static_assert(F(4, k) == 3, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
+int k = 0; // expected-note {{here}}
+static_assert(F(4, k) == 3, ""); // expected-error {{constant expression}} expected-note {{read of non-const variable 'k'}}
 
 }
 
@@ -165,7 +167,7 @@
   constexpr int f() { return 1; }
   typedef double (*DoubleFn)();
   typedef int (*IntFn)();
-  int a[(int)DoubleFn(f)()]; // expected-error {{variable length array}} expected-warning{{extension}}
+  int a[(int)DoubleFn(f)()]; // expected-error {{variable length array}} expected-warning{{C99 feature}}
   int b[(int)IntFn(f)()];    // ok
 }
 
@@ -188,26 +190,26 @@
 namespace ParameterScopes {
 
   const int k = 42;
-  constexpr const int &ObscureTheTruth(const int &a) { return a; }
-  constexpr const int &MaybeReturnJunk(bool b, const int a) {
-    return ObscureTheTruth(b ? a : k);
+  constexpr const int &ObscureTheTruth(const int &a) { return a; } // expected-note 3{{reference to 'a' cannot be returned from a constexpr function}}
+  constexpr const int &MaybeReturnJunk(bool b, const int a) { // expected-note 2{{declared here}}
+    return ObscureTheTruth(b ? a : k); // expected-note 2{{in call to 'ObscureTheTruth(a)'}}
   }
   static_assert(MaybeReturnJunk(false, 0) == 42, ""); // ok
-  constexpr int a = MaybeReturnJunk(true, 0); // expected-error {{constant expression}}
+  constexpr int a = MaybeReturnJunk(true, 0); // expected-error {{constant expression}} expected-note {{in call to 'MaybeReturnJunk(1, 0)'}}
 
-  constexpr const int MaybeReturnNonstaticRef(bool b, const int a) {
+  constexpr const int MaybeReturnNonstaticRef(bool b, const int a) { // expected-note {{here}}
     // If ObscureTheTruth returns a reference to 'a', the result is not a
     // constant expression even though 'a' is still in scope.
-    return ObscureTheTruth(b ? a : k);
+    return ObscureTheTruth(b ? a : k); // expected-note {{in call to 'ObscureTheTruth(a)'}}
   }
   static_assert(MaybeReturnNonstaticRef(false, 0) == 42, ""); // ok
-  constexpr int b = MaybeReturnNonstaticRef(true, 0); // expected-error {{constant expression}}
+  constexpr int b = MaybeReturnNonstaticRef(true, 0); // expected-error {{constant expression}} expected-note {{in call to 'MaybeReturnNonstaticRef(1, 0)'}}
 
   constexpr int InternalReturnJunk(int n) {
     // FIXME: We should reject this: it never produces a constant expression.
-    return MaybeReturnJunk(true, n);
+    return MaybeReturnJunk(true, n); // expected-note {{in call to 'MaybeReturnJunk(1, 0)'}}
   }
-  constexpr int n3 = InternalReturnJunk(0); // expected-error {{must be initialized by a constant expression}}
+  constexpr int n3 = InternalReturnJunk(0); // expected-error {{must be initialized by a constant expression}} expected-note {{in call to 'InternalReturnJunk(0)'}}
 
   constexpr int LToR(int &n) { return n; }
   constexpr int GrabCallersArgument(bool which, int a, int b) {
@@ -243,11 +245,11 @@
   constexpr auto Select(int n) -> int (*)(int) {
     return n == 2 ? &Double : n == 3 ? &Triple : n == 4 ? &Quadruple : 0;
   }
-  constexpr int Apply(int (*F)(int), int n) { return F(n); }
+  constexpr int Apply(int (*F)(int), int n) { return F(n); } // expected-note {{subexpression}}
 
   static_assert(1 + Apply(Select(4), 5) + Apply(Select(3), 7) == 42, "");
 
-  constexpr int Invalid = Apply(Select(0), 0); // expected-error {{must be initialized by a constant expression}}
+  constexpr int Invalid = Apply(Select(0), 0); // expected-error {{must be initialized by a constant expression}} expected-note {{in call to 'Apply(0, 0)'}}
 
 }
 
@@ -293,38 +295,33 @@
 static_assert(&x > &x, "false"); // expected-error {{false}}
 
 constexpr S* sptr = &s;
-// FIXME: This is not a constant expression; check we reject this and move this
-// test elsewhere.
-constexpr bool dyncast = sptr == dynamic_cast<S*>(sptr);
+constexpr bool dyncast = sptr == dynamic_cast<S*>(sptr); // expected-error {{constant expression}} expected-note {{dynamic_cast}}
 
 struct Str {
-  // FIXME: In C++ mode, we should say 'integral' not 'integer'
   int a : dynamic_cast<S*>(sptr) == dynamic_cast<S*>(sptr); // \
-    expected-warning {{not integer constant expression}} \
+    expected-warning {{not an integral constant expression}} \
     expected-note {{dynamic_cast is not allowed in a constant expression}}
   int b : reinterpret_cast<S*>(sptr) == reinterpret_cast<S*>(sptr); // \
-    expected-warning {{not integer constant expression}} \
+    expected-warning {{not an integral constant expression}} \
     expected-note {{reinterpret_cast is not allowed in a constant expression}}
   int c : (S*)(long)(sptr) == (S*)(long)(sptr); // \
-    expected-warning {{not integer constant expression}} \
+    expected-warning {{not an integral constant expression}} \
     expected-note {{cast which performs the conversions of a reinterpret_cast is not allowed in a constant expression}}
   int d : (S*)(42) == (S*)(42); // \
-    expected-warning {{not integer constant expression}} \
+    expected-warning {{not an integral constant expression}} \
     expected-note {{cast which performs the conversions of a reinterpret_cast is not allowed in a constant expression}}
   int e : (Str*)(sptr) == (Str*)(sptr); // \
-    expected-warning {{not integer constant expression}} \
+    expected-warning {{not an integral constant expression}} \
     expected-note {{cast which performs the conversions of a reinterpret_cast is not allowed in a constant expression}}
   int f : &(Str&)(*sptr) == &(Str&)(*sptr); // \
-    expected-warning {{not integer constant expression}} \
+    expected-warning {{not an integral constant expression}} \
     expected-note {{cast which performs the conversions of a reinterpret_cast is not allowed in a constant expression}}
   int g : (S*)(void*)(sptr) == sptr; // \
-    expected-warning {{not integer constant expression}} \
+    expected-warning {{not an integral constant expression}} \
     expected-note {{cast from 'void *' is not allowed in a constant expression}}
 };
 
 extern char externalvar[];
-// FIXME: This is not a constant expression; check we reject this and move this
-// test elsewhere.
 constexpr bool constaddress = (void *)externalvar == (void *)0x4000UL; // expected-error {{must be initialized by a constant expression}}
 constexpr bool litaddress = "foo" == "foo"; // expected-error {{must be initialized by a constant expression}} expected-warning {{unspecified}}
 static_assert(0 != "foo", "");
@@ -352,26 +349,22 @@
 
 namespace StringLiteral {
 
-// FIXME: Refactor this once we support constexpr templates.
-constexpr int MangleChars(const char *p) {
-  return *p + 3 * (*p ? MangleChars(p+1) : 0);
-}
-constexpr int MangleChars(const char16_t *p) {
-  return *p + 3 * (*p ? MangleChars(p+1) : 0);
-}
-constexpr int MangleChars(const char32_t *p) {
+template<typename Char>
+constexpr int MangleChars(const Char *p) {
   return *p + 3 * (*p ? MangleChars(p+1) : 0);
 }
 
 static_assert(MangleChars("constexpr!") == 1768383, "");
+static_assert(MangleChars(u8"constexpr!") == 1768383, "");
+static_assert(MangleChars(L"constexpr!") == 1768383, "");
 static_assert(MangleChars(u"constexpr!") == 1768383, "");
 static_assert(MangleChars(U"constexpr!") == 1768383, "");
 
 constexpr char c0 = "nought index"[0];
 constexpr char c1 = "nice index"[10];
-constexpr char c2 = "nasty index"[12]; // expected-error {{must be initialized by a constant expression}} expected-warning {{is past the end}}
-constexpr char c3 = "negative index"[-1]; // expected-error {{must be initialized by a constant expression}} expected-warning {{is before the beginning}}
-constexpr char c4 = ((char*)(int*)"no reinterpret_casts allowed")[14]; // expected-error {{must be initialized by a constant expression}}
+constexpr char c2 = "nasty index"[12]; // expected-error {{must be initialized by a constant expression}} expected-warning {{is past the end}} expected-note {{read of dereferenced one-past-the-end pointer}}
+constexpr char c3 = "negative index"[-1]; // expected-error {{must be initialized by a constant expression}} expected-warning {{is before the beginning}} expected-note {{cannot refer to element -1 of array of 15 elements}}
+constexpr char c4 = ((char*)(int*)"no reinterpret_casts allowed")[14]; // expected-error {{must be initialized by a constant expression}} expected-note {{cast which performs the conversions of a reinterpret_cast}}
 
 constexpr const char *p = "test" + 2;
 static_assert(*p == 's', "");
@@ -383,9 +376,6 @@
   return (a+1 >= b) ? a : max_iter(a, max_element(a+1, b));
 }
 
-constexpr const char *begin(const char (&arr)[45]) { return arr; }
-constexpr const char *end(const char (&arr)[45]) { return arr + 45; }
-
 constexpr char str[] = "the quick brown fox jumped over the lazy dog";
 constexpr const char *max = max_element(begin(str), end(str));
 static_assert(*max == 'z', "");
@@ -396,16 +386,38 @@
 static_assert(strcmp_ce("constexpr", "test") < 0, "");
 static_assert(strcmp_ce("", " ") < 0, "");
 
+struct S {
+  int n : "foo"[4]; // expected-error {{constant expression}} expected-note {{read of dereferenced one-past-the-end pointer is not allowed in a constant expression}}
+};
+
+struct T {
+  char c[6];
+  constexpr T() : c{"foo"} {}
+};
+constexpr T t;
+
+static_assert(t.c[0] == 'f', "");
+static_assert(t.c[1] == 'o', "");
+static_assert(t.c[2] == 'o', "");
+static_assert(t.c[3] == 0, "");
+static_assert(t.c[4] == 0, "");
+static_assert(t.c[5] == 0, "");
+static_assert(t.c[6] == 0, ""); // expected-error {{constant expression}} expected-note {{one-past-the-end}}
+
+struct U {
+  wchar_t chars[6];
+  int n;
+} constexpr u = { { L"test" }, 0 };
+static_assert(u.chars[2] == L's', "");
+
 }
 
 namespace Array {
 
-// FIXME: Use templates for these once we support constexpr templates.
-constexpr int Sum(const int *begin, const int *end) {
+template<typename Iter>
+constexpr auto Sum(Iter begin, Iter end) -> decltype(+*begin) {
   return begin == end ? 0 : *begin + Sum(begin+1, end);
 }
-constexpr const int *begin(const int (&xs)[5]) { return xs; }
-constexpr const int *end(const int (&xs)[5]) { return xs + 5; }
 
 constexpr int xs[] = { 1, 2, 3, 4, 5 };
 constexpr int ys[] = { 5, 4, 3, 2, 1 };
@@ -415,7 +427,7 @@
 constexpr int ZipFoldR(int (*F)(int x, int y, int c), int n,
                        const int *xs, const int *ys, int c) {
   return n ? F(
-               *xs, // expected-note {{subexpression not valid}}
+               *xs, // expected-note {{read of dereferenced one-past-the-end pointer}}
                *ys,
                ZipFoldR(F, n-1, xs+1, ys+1, c)) // \
       expected-note {{in call to 'ZipFoldR(&SubMul, 2, &xs[4], &ys[4], 1)'}} \
@@ -435,26 +447,29 @@
 
 constexpr const int *p = xs + 3;
 constexpr int xs4 = p[1]; // ok
-constexpr int xs5 = p[2]; // expected-error {{constant expression}}
+constexpr int xs5 = p[2]; // expected-error {{constant expression}} expected-note {{read of dereferenced one-past-the-end pointer}}
+constexpr int xs6 = p[3]; // expected-error {{constant expression}} expected-note {{cannot refer to element 6}}
 constexpr int xs0 = p[-3]; // ok
-constexpr int xs_1 = p[-4]; // expected-error {{constant expression}}
+constexpr int xs_1 = p[-4]; // expected-error {{constant expression}} expected-note {{cannot refer to element -1}}
 
 constexpr int zs[2][2][2][2] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
 static_assert(zs[0][0][0][0] == 1, "");
 static_assert(zs[1][1][1][1] == 16, "");
-static_assert(zs[0][0][0][2] == 3, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
+static_assert(zs[0][0][0][2] == 3, ""); // expected-error {{constant expression}} expected-note {{read of dereferenced one-past-the-end pointer}}
 static_assert((&zs[0][0][0][2])[-1] == 2, "");
 static_assert(**(**(zs + 1) + 1) == 11, "");
-static_assert(*(&(&(*(*&(&zs[2] - 1)[0] + 2 - 2))[2])[-1][-1] + 1) == 11, "");
+static_assert(*(&(&(*(*&(&zs[2] - 1)[0] + 2 - 2))[2])[-1][-1] + 1) == 11, ""); // expected-error {{constant expression}} expected-note {{cannot refer to element -1 of array of 2 elements in a constant expression}}
+static_assert(*(&(&(*(*&(&zs[2] - 1)[0] + 2 - 2))[2])[-1][2] - 2) == 11, "");
+constexpr int err_zs_1_2_0_0 = zs[1][2][0][0]; // expected-error {{constant expression}} expected-note {{cannot access array element of pointer past the end}}
 
 constexpr int fail(const int &p) {
-  return (&p)[64]; // expected-note {{subexpression}}
+  return (&p)[64]; // expected-note {{cannot refer to element 64 of array of 2 elements}}
 }
-static_assert(fail(*(&(&(*(*&(&zs[2] - 1)[0] + 2 - 2))[2])[-1][-1] + 1)) == 11, ""); // \
+static_assert(fail(*(&(&(*(*&(&zs[2] - 1)[0] + 2 - 2))[2])[-1][2] - 2)) == 11, ""); // \
 expected-error {{static_assert expression is not an integral constant expression}} \
 expected-note {{in call to 'fail(zs[1][0][1][0])'}}
 
-constexpr int arr[40] = { 1, 2, 3, [8] = 4 }; // expected-warning {{extension}}
+constexpr int arr[40] = { 1, 2, 3, [8] = 4 }; // expected-warning {{C99 feature}}
 constexpr int SumNonzero(const int *p) {
   return *p + (*p ? SumNonzero(p+1) : 0);
 }
@@ -510,20 +525,15 @@
 static_assert(D().c.n == 42, "");
 
 struct E {
-  constexpr E() : p(&p) {}
+  constexpr E() : p(&p) {} // expected-note {{pointer to subobject of temporary cannot be used to initialize a member in a constant expression}}
   void *p;
 };
-constexpr const E &e1 = E(); // expected-error {{constant expression}}
+constexpr const E &e1 = E(); // expected-error {{constant expression}} expected-note {{in call to 'E()'}} expected-note {{temporary created here}}
 // This is a constant expression if we elide the copy constructor call, and
 // is not a constant expression if we don't! But we do, so it is.
-// FIXME: The move constructor is not currently implicitly defined as constexpr.
-// We notice this when evaluating an expression which uses it, but not when
-// checking its initializer.
-constexpr E e2 = E(); // unexpected-error {{constant expression}}
-static_assert(e2.p == &e2.p, ""); // unexpected-error {{constant expression}} unexpected-note {{subexpression}}
-// FIXME: We don't pass through the fact that 'this' is ::e3 when checking the
-// initializer of this declaration.
-constexpr E e3; // unexpected-error {{constant expression}}
+constexpr E e2 = E();
+static_assert(e2.p == &e2.p, "");
+constexpr E e3;
 static_assert(e3.p == &e3.p, "");
 
 extern const class F f;
@@ -531,7 +541,7 @@
   constexpr F() : p(&f.p) {}
   const void *p;
 };
-constexpr F f = F();
+constexpr F f;
 
 struct G {
   struct T {
@@ -548,10 +558,10 @@
   constexpr G() : t(&t) {}
 } constexpr g;
 
-static_assert(g.t.u1.a == 42, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
+static_assert(g.t.u1.a == 42, ""); // expected-error {{constant expression}} expected-note {{read of member 'a' of union with active member 'b'}}
 static_assert(g.t.u1.b == 42, "");
 static_assert(g.t.u2.c == 42, "");
-static_assert(g.t.u2.d == 42, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
+static_assert(g.t.u2.d == 42, ""); // expected-error {{constant expression}} expected-note {{read of member 'd' of union with active member 'c'}}
 
 struct S {
   int a, b;
@@ -595,10 +605,10 @@
 static_assert(strcmp_ce(&agg1.c, "hello") == 0, "");
 static_assert(agg1.n == 0, "");
 static_assert(agg1.d == 0.0, "");
-static_assert(agg1.arr[-1] == 0, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
+static_assert(agg1.arr[-1] == 0, ""); // expected-error {{constant expression}} expected-note {{cannot refer to element -1}}
 static_assert(agg1.arr[0] == 0, "");
 static_assert(agg1.arr[4] == 0, "");
-static_assert(agg1.arr[5] == 0, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
+static_assert(agg1.arr[5] == 0, ""); // expected-error {{constant expression}} expected-note {{read of dereferenced one-past-the-end}}
 static_assert(agg1.p == nullptr, "");
 
 namespace SimpleDerivedClass {
@@ -624,10 +634,7 @@
 struct Base2 : Bottom {
   constexpr Base2(const int &r) : r(r) {}
   int q = 123;
-  // FIXME: When we track the global for which we are computing the initializer,
-  // use a reference here.
-  //const int &r;
-  int r;
+  const int &r;
 };
 struct Derived : Base, Base2 {
   constexpr Derived() : Base(76), Base2(a) {}
@@ -646,7 +653,7 @@
 static_assert(derived.c == 76 + 'e', "");
 static_assert(derived.q == 123, "");
 static_assert(derived.r == 76, "");
-static_assert(&derived.r == &derived.a, ""); // expected-error {{}}
+static_assert(&derived.r == &derived.a, "");
 
 static_assert(!(derived == base), "");
 static_assert(derived == base2, "");
@@ -661,13 +668,13 @@
 static_assert(pb1 == &bot1, "");
 static_assert(pb2 == &bot2, "");
 
-constexpr Base2 &fail = (Base2&)bot1; // expected-error {{constant expression}}
-constexpr Base &fail2 = (Base&)*pb2; // expected-error {{constant expression}}
+constexpr Base2 &fail = (Base2&)bot1; // expected-error {{constant expression}} expected-note {{cannot cast object of dynamic type 'const Class::Derived' to type 'Class::Base2'}}
+constexpr Base &fail2 = (Base&)*pb2; // expected-error {{constant expression}} expected-note {{cannot cast object of dynamic type 'const Class::Derived' to type 'Class::Base'}}
 constexpr Base2 &ok2 = (Base2&)bot2;
 static_assert(&ok2 == &derived, "");
 
-constexpr Base2 *pfail = (Base2*)pb1; // expected-error {{constant expression}}
-constexpr Base *pfail2 = (Base*)&bot2; // expected-error {{constant expression}}
+constexpr Base2 *pfail = (Base2*)pb1; // expected-error {{constant expression}} expected-note {{cannot cast object of dynamic type 'const Class::Derived' to type 'Class::Base2'}}
+constexpr Base *pfail2 = (Base*)&bot2; // expected-error {{constant expression}} expected-note {{cannot cast object of dynamic type 'const Class::Derived' to type 'Class::Base'}}
 constexpr Base2 *pok2 = (Base2*)pb2;
 static_assert(pok2 == &derived, "");
 static_assert(&ok2 == pok2, "");
@@ -679,6 +686,28 @@
 static_assert((Derived*)nullB == 0, "");
 static_assert((void*)(Bottom*)nullB == (void*)(Derived*)nullB, "");
 
+namespace ConversionOperators {
+
+struct T {
+  constexpr T(int n) : k(5*n - 3) {}
+  constexpr operator int() { return k; }
+  int k;
+};
+
+struct S {
+  constexpr S(int n) : k(2*n + 1) {}
+  constexpr operator int() { return k; }
+  constexpr operator T() { return T(k); }
+  int k;
+};
+
+constexpr bool check(T a, T b) { return a == b.k; }
+
+static_assert(S(5) == 11, "");
+static_assert(check(S(5), 11), "");
+
+}
+
 }
 
 namespace Temporaries {
@@ -717,14 +746,26 @@
   int b;
 };
 
-constexpr U u[4] = { { .a = 0 }, { .b = 1 }, { .a = 2 }, { .b = 3 } }; // expected-warning 4{{extension}}
+constexpr U u[4] = { { .a = 0 }, { .b = 1 }, { .a = 2 }, { .b = 3 } }; // expected-warning 4{{C99 feature}}
 static_assert(u[0].a == 0, "");
-static_assert(u[0].b, ""); // expected-error {{constant expression}}
+static_assert(u[0].b, ""); // expected-error {{constant expression}} expected-note {{read of member 'b' of union with active member 'a'}}
 static_assert(u[1].b == 1, "");
-static_assert((&u[1].b)[1] == 2, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
-static_assert(*(&(u[1].b) + 1 + 1) == 3, ""); // expected-error {{constant expression}} expected-note {{subexpression}}
+static_assert((&u[1].b)[1] == 2, ""); // expected-error {{constant expression}} expected-note {{read of dereferenced one-past-the-end pointer}}
+static_assert(*(&(u[1].b) + 1 + 1) == 3, ""); // expected-error {{constant expression}} expected-note {{cannot refer to element 2 of non-array object}}
 static_assert((&(u[1]) + 1 + 1)->b == 3, "");
 
+constexpr U v = {};
+static_assert(v.a == 0, "");
+
+union Empty {};
+constexpr Empty e = {};
+
+// Make sure we handle trivial copy constructors for unions.
+constexpr U x = {42};
+constexpr U y = x;
+static_assert(y.a == 42, "");
+static_assert(y.b == 42, ""); // expected-error {{constant expression}} expected-note {{'b' of union with active member 'a'}}
+
 }
 
 namespace MemberPointer {
@@ -797,7 +838,7 @@
 
   constexpr T<5> *p17_5 = &t17;
   constexpr T<13> *p17_13 = (T<13>*)p17_5;
-  constexpr T<23> *p17_23 = (T<23>*)p17_13; // expected-error {{constant expression}}
+  constexpr T<23> *p17_23 = (T<23>*)p17_13; // expected-error {{constant expression}} expected-note {{cannot cast object of dynamic type 'T<17>' to type 'T<23>'}}
   static_assert(&(p17_5->*(int(T<3>::*))deepn) == &t17.n, "");
   static_assert(&(p17_13->*deepn) == &t17.n, "");
   constexpr int *pbad2 = &(p17_13->*(int(T<9>::*))deepm); // expected-error {{constant expression}}
@@ -831,15 +872,15 @@
 
   // pb3 does not point to an array element.
   constexpr Base *pb4 = pb3 + 1; // ok, one-past-the-end pointer.
-  constexpr int pb4n = pb4->n; // expected-error {{constant expression}}
-  constexpr Base *err_pb5 = pb3 + 2; // FIXME: reject this.
-  constexpr int err_pb5n = err_pb5->n; // expected-error {{constant expression}}
-  constexpr Base *err_pb2 = pb3 - 1; // FIXME: reject this.
-  constexpr int err_pb2n = err_pb2->n; // expected-error {{constant expression}}
+  constexpr int pb4n = pb4->n; // expected-error {{constant expression}} expected-note {{cannot access field of pointer past the end}}
+  constexpr Base *err_pb5 = pb3 + 2; // expected-error {{constant expression}} expected-note {{cannot refer to element 2}} expected-note {{here}}
+  constexpr int err_pb5n = err_pb5->n; // expected-error {{constant expression}} expected-note {{initializer of 'err_pb5' is not a constant expression}}
+  constexpr Base *err_pb2 = pb3 - 1; // expected-error {{constant expression}} expected-note {{cannot refer to element -1}} expected-note {{here}}
+  constexpr int err_pb2n = err_pb2->n; // expected-error {{constant expression}} expected-note {{initializer of 'err_pb2'}}
   constexpr Base *pb3a = pb4 - 1;
 
   // pb4 does not point to a Derived.
-  constexpr Derived *err_pd4 = (Derived*)pb4; // expected-error {{constant expression}}
+  constexpr Derived *err_pd4 = (Derived*)pb4; // expected-error {{constant expression}} expected-note {{cannot access derived class of pointer past the end}}
   constexpr Derived *pd3a = (Derived*)pb3a;
   constexpr int pd3n = pd3a->n;
 
@@ -849,9 +890,9 @@
   constexpr Derived *pd9 = pd6 + 3;
   constexpr Derived *pd10 = pd6 + 4;
   constexpr int pd9n = pd9->n; // ok
-  constexpr int err_pd10n = pd10->n; // expected-error {{constant expression}}
+  constexpr int err_pd10n = pd10->n; // expected-error {{constant expression}} expected-note {{cannot access base class of pointer past the end}}
   constexpr int pd0n = pd10[-10].n;
-  constexpr int err_pdminus1n = pd10[-11].n; // expected-error {{constant expression}}
+  constexpr int err_pdminus1n = pd10[-11].n; // expected-error {{constant expression}} expected-note {{cannot refer to element -1 of}}
 
   constexpr Base *pb9 = pd9;
   constexpr const int *(Base::*pfb)() const =
@@ -922,6 +963,67 @@
 
 namespace PR11595 {
   struct A { constexpr bool operator==(int x) { return true; } };
-  struct B { B(); ~B(); A& x; };
-  static_assert(B().x == 3, "");  // expected-error {{constant expression}}
+  struct B { B(); A& x; };
+  static_assert(B().x == 3, "");  // expected-error {{constant expression}} expected-note {{non-literal type 'PR11595::B' cannot be used in a constant expression}}
+
+  constexpr bool f(int k) {
+    return B().x == k; // expected-note {{non-literal type 'PR11595::B' cannot be used in a constant expression}}
+  }
+  constexpr int n = f(1); // expected-error {{must be initialized by a constant expression}} expected-note {{in call to 'f(1)'}}
+}
+
+namespace ExprWithCleanups {
+  struct A { A(); ~A(); int get(); };
+  constexpr int get(bool FromA) { return FromA ? A().get() : 1; }
+  constexpr int n = get(false);
+}
+
+namespace Volatile {
+
+volatile constexpr int n1 = 0; // expected-note {{here}}
+volatile const int n2 = 0; // expected-note {{here}}
+int n3 = 37; // expected-note {{declared here}}
+
+constexpr int m1 = n1; // expected-error {{constant expression}} expected-note {{read of volatile object 'n1'}}
+constexpr int m2 = n2; // expected-error {{constant expression}} expected-note {{read of volatile object 'n2'}}
+
+struct T { int n; };
+const T t = { 42 }; // expected-note {{declared here}}
+
+constexpr int f(volatile int &&r) {
+  return r; // expected-note {{read of volatile temporary is not allowed in a constant expression}}
+}
+struct S {
+  int k : f(0); // expected-error {{constant expression}} expected-note {{temporary created here}} expected-note {{in call to 'f(0)'}}
+  int l : n3; // expected-error {{constant expression}} expected-note {{read of non-const variable}}
+  int m : t.n; // expected-error {{constant expression}} expected-note {{read of non-constexpr variable}}
+};
+
+}
+
+namespace ExternConstexpr {
+  extern constexpr int n = 0;
+  extern constexpr int m; // expected-error {{constexpr variable declaration must be a definition}}
+  void f() {
+    extern constexpr int i; // expected-error {{constexpr variable declaration must be a definition}}
+    constexpr int j = 0;
+    constexpr int k; // expected-error {{default initialization of an object of const type}}
+  }
+}
+
+namespace ComplexConstexpr {
+  constexpr _Complex float test1 = {};
+  constexpr _Complex float test2 = {1};
+  constexpr _Complex double test3 = {1,2};
+  constexpr _Complex int test4 = {4};
+  constexpr _Complex int test5 = 4;
+  constexpr _Complex int test6 = {5,6};
+  typedef _Complex float fcomplex;
+  constexpr fcomplex test7 = fcomplex();
+}
+
+namespace InstantiateCaseStmt {
+  template<int x> constexpr int f() { return x; }
+  template<int x> int g(int c) { switch(c) { case f<x>(): return 1; } return 0; }
+  int gg(int c) { return g<4>(c); }
 }

Modified: cfe/branches/tooling/test/SemaCXX/constant-expression.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/constant-expression.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/constant-expression.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/constant-expression.cpp Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 -pedantic %s
 // C++ [expr.const]p1:
 //   In several places, C++ requires expressions that evaluate to an integral
 //   or enumeration constant: as array bounds, as case expressions, as
@@ -88,10 +88,10 @@
 
 void diags(int n) {
   switch (n) {
-    case (1/0, 1): // expected-error {{not an integer constant expression}} expected-note {{division by zero}}
-    case (int)(1/0, 2.0): // expected-error {{not an integer constant expression}} expected-note {{division by zero}}
-    case __imag(1/0): // expected-error {{not an integer constant expression}} expected-note {{division by zero}}
-    case (int)__imag((double)(1/0)): // expected-error {{not an integer constant expression}} expected-note {{division by zero}}
+    case (1/0, 1): // expected-error {{not an integral constant expression}} expected-note {{division by zero}}
+    case (int)(1/0, 2.0): // expected-error {{not an integral constant expression}} expected-note {{division by zero}}
+    case __imag(1/0): // expected-error {{not an integral constant expression}} expected-note {{division by zero}}
+    case (int)__imag((double)(1/0)): // expected-error {{not an integral constant expression}} expected-note {{division by zero}}
       ;
   }
 }
@@ -102,3 +102,18 @@
   template<int n> struct S {};
   S<p> s; // expected-error {{not an integral constant expression}}
 }
+
+extern const int recurse1;
+// recurse2 cannot be used in a constant expression because it is not
+// initialized by a constant expression. The same expression appearing later in
+// the TU would be a constant expression, but here it is not.
+const int recurse2 = recurse1;
+const int recurse1 = 1;
+int array1[recurse1]; // ok
+int array2[recurse2]; // expected-warning {{variable length array}} expected-warning {{integer constant expression}}
+
+namespace FloatConvert {
+  typedef int a[(int)42.3];
+  typedef int a[(int)42.997];
+  typedef int b[(int)4e10]; // expected-warning {{variable length}} expected-error {{variable length}}
+}

Modified: cfe/branches/tooling/test/SemaCXX/constexpr-backtrace-limit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/constexpr-backtrace-limit.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/constexpr-backtrace-limit.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/constexpr-backtrace-limit.cpp Fri Jan 20 10:14:22 2012
@@ -15,14 +15,14 @@
 
 // RUN: %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 2 -fconstexpr-depth 8 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST3
 // TEST3: constant expression
-// TEST3-NEXT: subexpression
+// TEST3-NEXT: reinterpret_cast
 // TEST3-NEXT: in call to 'recurse(0)'
 // TEST3-NEXT: skipping 4 calls
 // TEST3-NEXT: in call to 'recurse(5)'
 
 // RUN: %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 8 -fconstexpr-depth 8 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST4
 // TEST4: constant expression
-// TEST4-NEXT: subexpression
+// TEST4-NEXT: reinterpret_cast
 // TEST4-NEXT: in call to 'recurse(0)'
 // TEST4-NEXT: in call to 'recurse(1)'
 // TEST4-NEXT: in call to 'recurse(2)'

Modified: cfe/branches/tooling/test/SemaCXX/constexpr-depth.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/constexpr-depth.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/constexpr-depth.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/constexpr-depth.cpp Fri Jan 20 10:14:22 2012
@@ -1,8 +1,8 @@
 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s -DMAX=128 -fconstexpr-depth 128
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s -DMAX=1 -fconstexpr-depth 1
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s -DMAX=2 -fconstexpr-depth 2
 // RUN: %clang -std=c++11 -fsyntax-only -Xclang -verify %s -DMAX=10 -fconstexpr-depth=10
 
-constexpr int depth(int n) { return n > 1 ? depth(n-1) : 0; }
+constexpr int depth(int n) { return n > 1 ? depth(n-1) : 0; } // expected-note {{exceeded maximum depth}} expected-note +{{}}
 
-constexpr int kBad = depth(MAX + 1); // expected-error {{must be initialized by a constant expression}}
+constexpr int kBad = depth(MAX + 1); // expected-error {{must be initialized by a constant expression}} expected-note {{in call to 'depth(}}
 constexpr int kGood = depth(MAX);

Modified: cfe/branches/tooling/test/SemaCXX/constexpr-printing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/constexpr-printing.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/constexpr-printing.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/constexpr-printing.cpp Fri Jan 20 10:14:22 2012
@@ -1,19 +1,21 @@
 // RUN: %clang_cc1 %s -std=c++11 -fsyntax-only -verify
 
-constexpr int extract(struct S &s);
+struct S;
+constexpr int extract(const S &s);
 
 struct S {
-  constexpr S() : n(extract(*this)), m(0) {}
+  constexpr S() : n(extract(*this)), m(0) {} // expected-note {{in call to 'extract(s1)'}}
   constexpr S(int k) : n(k), m(extract(*this)) {}
   int n, m;
 };
 
-constexpr int extract(S &s) { return s.n; }
+constexpr int extract(const S &s) { return s.n; } // expected-note {{read of uninitialized object is not allowed in a constant expression}}
 
-// FIXME: once we produce notes for constexpr variable declarations, this should
-// produce a note indicating that S.n is used uninitialized.
-constexpr S s1; // expected-error {{constant expression}}
-constexpr S s2(10);
+constexpr S s1; // ok
+void f() {
+  constexpr S s1; // expected-error {{constant expression}} expected-note {{in call to 'S()'}}
+  constexpr S s2(10);
+}
 
 typedef __attribute__((vector_size(16))) int vector_int;
 
@@ -31,9 +33,9 @@
 
 constexpr int test_printing(int a, float b, _Complex int c, _Complex float d,
                             int *e, int &f, vector_int g, U h) {
-  return *e; // expected-note {{subexpression}}
+  return *e; // expected-note {{read of non-constexpr variable 'u2'}}
 }
-U u2(0);
+U u2(0); // expected-note {{here}}
 static_assert(test_printing(12, 39.762, 3 + 4i, 12.9 + 3.6i, &u2.arr[4], u2.another.arr[2], (vector_int){5, 1, 2, 3}, u1) == 0, ""); // \
 expected-error {{constant expression}} \
 expected-note {{in call to 'test_printing(12, 3.976200e+01, 3+4i, 1.290000e+01+3.600000e+00i, &u2.T::arr[4], u2.another.arr[2], {5, 1, 2, 3}, {{{}}, {{}}, &u1.T::arr[2]})'}}
@@ -46,7 +48,7 @@
   int arr[256];
 };
 constexpr V v;
-constexpr int get(const int *p) { return *p; } // expected-note {{subexpression}}
+constexpr int get(const int *p) { return *p; } // expected-note {{read of dereferenced one-past-the-end pointer}}
 constexpr int passLargeArray(V v) { return get(v.arr+256); } // expected-note {{in call to 'get(&v.arr[256])'}}
 static_assert(passLargeArray(v) == 0, ""); // expected-error {{constant expression}} expected-note {{in call to 'passLargeArray({{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...}})'}}
 
@@ -57,7 +59,7 @@
 };
 constexpr Union myUnion = 76;
 
-constexpr int badness(Union u) { return u.a + u.b; } // expected-note {{subexpression}}
+constexpr int badness(Union u) { return u.a + u.b; } // expected-note {{read of member 'a' of union with active member 'b'}}
 static_assert(badness(myUnion), ""); // expected-error {{constant expression}} \
         expected-note {{in call to 'badness({.b = 76})'}}
 
@@ -65,9 +67,32 @@
   int n;
   void f();
 };
-MemPtrTest mpt;
+MemPtrTest mpt; // expected-note {{here}}
 constexpr int MemPtr(int (MemPtrTest::*a), void (MemPtrTest::*b)(), int &c) {
-  return c; // expected-note {{subexpression}}
+  return c; // expected-note {{read of non-constexpr variable 'mpt'}}
 }
 static_assert(MemPtr(&MemPtrTest::n, &MemPtrTest::f, mpt.*&MemPtrTest::n), ""); // expected-error {{constant expression}} \
 expected-note {{in call to 'MemPtr(&MemPtrTest::n, &MemPtrTest::f, mpt.n)'}}
+
+template<typename CharT>
+constexpr CharT get(const CharT *p) { return p[-1]; } // expected-note 5{{}}
+
+constexpr char c = get("test\0\\\"\t\a\b\234"); // \
+  expected-error {{}} expected-note {{"test\000\\\"\t\a\b\234"}}
+constexpr char c8 = get(u8"test\0\\\"\t\a\b\234"); // \
+  expected-error {{}} expected-note {{u8"test\000\\\"\t\a\b\234"}}
+constexpr char16_t c16 = get(u"test\0\\\"\t\a\b\234\u1234"); // \
+  expected-error {{}} expected-note {{u"test\000\\\"\t\a\b\234\u1234"}}
+constexpr char32_t c32 = get(U"test\0\\\"\t\a\b\234\u1234\U0010ffff"); // \
+  expected-error {{}} expected-note {{U"test\000\\\"\t\a\b\234\u1234\U0010FFFF"}}
+constexpr wchar_t wc = get(L"test\0\\\"\t\a\b\234\u1234"); // \
+  expected-error {{}} expected-note {{L"test\000\\\"\t\a\b\234\u1234"}}
+
+constexpr char32_t c32_err = get(U"\U00110000"); // expected-error {{invalid universal character}}
+
+typedef decltype(sizeof(int)) LabelDiffTy;
+constexpr LabelDiffTy mulBy3(LabelDiffTy x) { return x * 3; } // expected-note {{subexpression}}
+void LabelDiffTest() {
+  static_assert(mulBy3((LabelDiffTy)&&a-(LabelDiffTy)&&b) == 3, ""); // expected-error {{constant expression}} expected-note {{call to 'mulBy3(&&a - &&b)'}}
+  a:b:return;
+}

Modified: cfe/branches/tooling/test/SemaCXX/cxx0x-class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/cxx0x-class.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/cxx0x-class.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/cxx0x-class.cpp Fri Jan 20 10:14:22 2012
@@ -11,18 +11,18 @@
   int i = 0;
   static int si = 0; // expected-error {{non-const static data member must be initialized out of line}}
   static const NestedC ci = 0; // expected-error {{static data member of type 'const C::NestedC' must be initialized out of line}}
-  static const int nci = vs; // expected-error {{in-class initializer is not a constant expression}}
+  static const int nci = vs; // expected-error {{in-class initializer for static data member is not a constant expression}}
   static const int vi = 0;
   static const volatile int cvi = 0; // expected-error {{static const volatile data member must be initialized out of line}}
 };
 
 namespace rdar8367341 {
-  float foo();
+  float foo(); // expected-note {{here}}
 
   struct A {
     static const float x = 5.0f; // expected-warning {{GNU extension}} expected-note {{use 'constexpr' specifier to silence this warning}}
-    static const float y = foo(); // expected-warning {{GNU extension}} expected-note {{use 'constexpr' specifier to silence this warning}} expected-error {{in-class initializer is not a constant expression}}
+    static const float y = foo(); // expected-warning {{GNU extension}} expected-note {{use 'constexpr' specifier to silence this warning}} expected-error {{in-class initializer for static data member is not a constant expression}}
     static constexpr float x2 = 5.0f;
-    static constexpr float y2 = foo(); // expected-error {{must be initialized by a constant expression}}
+    static constexpr float y2 = foo(); // expected-error {{must be initialized by a constant expression}} expected-note {{non-constexpr function 'foo'}}
   };
 }

Modified: cfe/branches/tooling/test/SemaCXX/cxx0x-initializer-scalars.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/cxx0x-initializer-scalars.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/cxx0x-initializer-scalars.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/cxx0x-initializer-scalars.cpp Fri Jan 20 10:14:22 2012
@@ -55,5 +55,4 @@
     emptylist({});
     emptylist({}, {}, {});
   }
-
 }

Modified: cfe/branches/tooling/test/SemaCXX/cxx98-compat.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/cxx98-compat.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/cxx98-compat.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/cxx98-compat.cpp Fri Jan 20 10:14:22 2012
@@ -34,7 +34,8 @@
 }
 
 void Lambda() {
-  []{}; // expected-warning {{lambda expressions are incompatible with C++98}}
+  // FIXME: Enable when lambdas are minimally working.
+  //[]{}; // FIXME-warning {{lambda expressions are incompatible with C++98}}
 }
 
 int InitList() {

Modified: cfe/branches/tooling/test/SemaCXX/decl-expr-ambiguity.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/decl-expr-ambiguity.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/decl-expr-ambiguity.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/decl-expr-ambiguity.cpp Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -pedantic-errors %s 
+// RUN: %clang_cc1 -fsyntax-only -verify -pedantic-errors %s
 
 void f() {
   int a;
@@ -24,14 +24,43 @@
   // Declarations.
   int fd(T(a)); // expected-warning {{parentheses were disambiguated as a function declarator}}
   T(*d)(int(p)); // expected-warning {{parentheses were disambiguated as a function declarator}} expected-note {{previous definition is here}}
+  typedef T(*td)(int(p));
+  extern T(*tp)(int(p));
+  T d3(); // expected-warning {{empty parentheses interpreted as a function declaration}} expected-note {{replace parentheses with an initializer}}
+  T d3v(void);
+  typedef T d3t();
+  extern T f3();
+  __typeof(*T()) f4(); // expected-warning {{empty parentheses interpreted as a function declaration}} expected-note {{replace parentheses with an initializer}}
+  typedef void *V;
+  __typeof(*V()) f5();
+  T multi1,
+    multi2(); // expected-warning {{empty parentheses interpreted as a function declaration}} expected-note {{replace parentheses with an initializer}}
   T(d)[5]; // expected-error {{redefinition of 'd'}}
   typeof(int[])(f) = { 1, 2 }; // expected-error {{extension used}}
   void(b)(int);
-  int(d2) __attribute__(()); 
+  int(d2) __attribute__(());
   if (int(a)=1) {}
   int(d3(int()));
 }
 
+struct RAII {
+  RAII();
+  ~RAII();
+};
+
+void func();
+namespace N {
+  struct S;
+
+  void emptyParens() {
+    RAII raii(); // expected-warning {{function declaration}} expected-note {{remove parentheses to declare a variable}}
+    int a, b, c, d, e, // expected-note {{change this ',' to a ';' to call 'func'}}
+    func(); // expected-warning {{function declaration}} expected-note {{replace parentheses with an initializer}}
+
+    S s(); // expected-warning {{function declaration}}
+  }
+}
+
 class C { };
 void fn(int(C)) { } // void fn(int(*fp)(C c)) { } expected-note{{candidate function}}
                     // not: void fn(int C);

Modified: cfe/branches/tooling/test/SemaCXX/decltype.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/decltype.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/decltype.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/decltype.cpp Fri Jan 20 10:14:22 2012
@@ -20,4 +20,11 @@
   class A{
       A(decltype(nullptr) param);
   };
-}
\ No newline at end of file
+}
+
+template<typename T> struct S {};
+template<typename T> auto f(T t) -> decltype(S<int>(t)) {
+  using U = decltype(S<int>(t));
+  using U = S<int>;
+  return S<int>(t);
+}

Modified: cfe/branches/tooling/test/SemaCXX/dependent-auto.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/dependent-auto.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/dependent-auto.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/dependent-auto.cpp Fri Jan 20 10:14:22 2012
@@ -8,7 +8,7 @@
 
 template<typename ...T>
 void f(T ...t) {
-  auto x(t...); // expected-error {{requires an initializer}} expected-error {{contains multiple expressions}}
+  auto x(t...); // expected-error {{is empty}} expected-error {{contains multiple expressions}}
   only<int> check = x;
 }
 

Modified: cfe/branches/tooling/test/SemaCXX/empty-class-layout.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/empty-class-layout.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/empty-class-layout.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/empty-class-layout.cpp Fri Jan 20 10:14:22 2012
@@ -144,3 +144,14 @@
 SA(0, sizeof(B) == 16);
 
 }
+
+namespace Test7 {
+  // Make sure we reserve enough space for both bases; PR11745.
+  struct Empty { };
+  struct Base1 : Empty { };
+  struct Base2 : Empty { };
+  struct Test : Base1, Base2 {
+    char c;
+  };
+  SA(0, sizeof(Test) == 2);
+}

Modified: cfe/branches/tooling/test/SemaCXX/enum-bitfield.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/enum-bitfield.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/enum-bitfield.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/enum-bitfield.cpp Fri Jan 20 10:14:22 2012
@@ -2,7 +2,7 @@
 
 enum E {};
 
-struct Z {}; // expected-note {{here}}
+struct Z {};
 typedef int Integer;
 
 struct X {
@@ -14,5 +14,5 @@
 
 struct Y {
   enum E : int(2);
-  enum E : Z(); // expected-error{{not an integer constant}} expected-note {{non-constexpr constructor 'Z'}}
+  enum E : Z(); // expected-error{{not an integral constant}}
 };

Modified: cfe/branches/tooling/test/SemaCXX/enum-scoped.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/enum-scoped.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/enum-scoped.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/enum-scoped.cpp Fri Jan 20 10:14:22 2012
@@ -39,7 +39,7 @@
 enum class E4 {
   e1 = -2147483648, // ok
   e2 = 2147483647, // ok
-  e3 = 2147483648 // expected-error{{value is not representable}}
+  e3 = 2147483648 // expected-error{{enumerator value evaluates to 2147483648, which cannot be narrowed to type 'int'}}
 };
 
 enum class E5 {
@@ -147,3 +147,30 @@
   const int val = 104;
   enum class test1 { owner_dead = val, };
 }
+
+namespace N2764 {
+  enum class E { a, b };
+  enum E x1 = E::a; // ok
+  enum class E x2 = E::a; // expected-error {{reference to scoped enumeration must use 'enum' not 'enum class'}}
+
+  enum F { a, b };
+  enum F y1 = a; // ok
+  enum class F y2 = a; // expected-error {{reference to enumeration must use 'enum' not 'enum class'}}
+
+  struct S {
+    friend enum class E; // expected-error {{reference to scoped enumeration must use 'enum' not 'enum class'}}
+    friend enum class F; // expected-error {{reference to enumeration must use 'enum' not 'enum class'}}
+
+    friend enum G {}; // expected-error {{forward reference}} expected-error {{cannot define a type in a friend declaration}}
+    friend enum class H {}; // expected-error {{cannot define a type in a friend declaration}}
+
+    enum A : int;
+    A a;
+  } s;
+
+  enum S::A : int {};
+
+  enum class B;
+}
+
+enum class N2764::B {};

Modified: cfe/branches/tooling/test/SemaCXX/enum.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/enum.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/enum.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/enum.cpp Fri Jan 20 10:14:22 2012
@@ -88,7 +88,7 @@
 
 // PR7921
 enum PR7921E {
-    PR7921V = (PR7921E)(123) // expected-error {{expression is not an integer constant expression}}
+    PR7921V = (PR7921E)(123) // expected-error {{expression is not an integral constant expression}}
 };
 
 void PR8089() {

Modified: cfe/branches/tooling/test/SemaCXX/for-range-no-std.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/for-range-no-std.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/for-range-no-std.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/for-range-no-std.cpp Fri Jan 20 10:14:22 2012
@@ -36,3 +36,8 @@
   for (int b : NS::ADL()) {} // ok
   for (int b : NS::NoADL()) {} // expected-error {{no matching function for call to 'begin'}} expected-note {{range has type}}
 }
+
+void PR11601() {
+  void (*vv[])() = {PR11601, PR11601, PR11601};
+  for (void (*i)() : vv) i();
+}

Modified: cfe/branches/tooling/test/SemaCXX/generalized-initializers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/generalized-initializers.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/generalized-initializers.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/generalized-initializers.cpp Fri Jan 20 10:14:22 2012
@@ -38,20 +38,6 @@
   };
 }
 
-namespace integral {
-
-  void initializer_list() {
-    std::initializer_list<int> il = { 1, 2, 3 };
-    std::initializer_list<double> dl = { 1.0, 2.0, 3 };
-    auto l = {1, 2, 3, 4};
-    static_assert(same_type<decltype(l), std::initializer_list<int>>::value, "");
-    auto bl = {1, 2.0}; // expected-error {{cannot deduce}}
-
-    for (int i : {1, 2, 3, 4}) {}
-  }
-
-}
-
 namespace objects {
 
   struct X1 { X1(int); };
@@ -152,7 +138,7 @@
   C c({1, 2}); // expected-error {{}}
 
   // valid (by copy constructor).
-  C d({1, 2L}); // expected-error {{}}
+  C d({1, 2L});
 
   // valid
   C e{1, 2};

Modified: cfe/branches/tooling/test/SemaCXX/i-c-e-cxx.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/i-c-e-cxx.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/i-c-e-cxx.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/i-c-e-cxx.cpp Fri Jan 20 10:14:22 2012
@@ -16,9 +16,9 @@
 }
 
 int a() {
-  const int t=t;
+  const int t=t; // expected-note {{declared here}}
   switch(1) { // expected-warning {{no case matching constant switch condition '1'}}
-    case t:; // expected-error {{not an integer constant expression}}
+    case t:; // expected-error {{not an integral constant expression}} expected-note {{initializer of 't' is not a constant expression}}
   }
 }
 
@@ -48,7 +48,7 @@
 namespace rdar9204520 {
   
 struct A {
-  static const int B = int(0.75 * 1000 * 1000); // expected-warning {{not a constant expression, accepted as an extension}}
+  static const int B = int(0.75 * 1000 * 1000); // expected-warning {{not a constant expression; folding it to a constant is a GNU extension}}
 };
 
 int foo() { return A::B; }

Modified: cfe/branches/tooling/test/SemaCXX/member-expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/member-expr.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/member-expr.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/member-expr.cpp Fri Jan 20 10:14:22 2012
@@ -94,11 +94,11 @@
 namespace PR7508 {
   struct A {
     struct CleanupScope {};
-    void PopCleanupBlock();
+    void PopCleanupBlock(); // expected-note{{'PopCleanupBlock' declared here}}
   };
 
   void foo(A &a) {
-    a.PopCleanupScope(); // expected-error{{no member named 'PopCleanupScope' in 'PR7508::A'}}
+    a.PopCleanupScope(); // expected-error{{no member named 'PopCleanupScope' in 'PR7508::A'; did you mean 'PopCleanupBlock'?}}
   }
 }
 
@@ -147,3 +147,13 @@
     return fun5.x; // expected-error{{reference to overloaded function could not be resolved; did you mean to call it?}}
   }
 }
+
+namespace FuncInMemberExpr {
+  struct Vec { int size(); };
+  Vec fun1();
+  int test1() { return fun1.size(); } // expected-error {{base of member reference is a function; perhaps you meant to call it with no arguments}}
+  Vec *fun2();
+  int test2() { return fun2->size(); } // expected-error {{base of member reference is a function; perhaps you meant to call it with no arguments}}
+  Vec fun3(int x = 0);
+  int test3() { return fun3.size(); } // expected-error {{base of member reference is a function; perhaps you meant to call it with no arguments}}
+}

Modified: cfe/branches/tooling/test/SemaCXX/overloaded-operator.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/overloaded-operator.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/overloaded-operator.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/overloaded-operator.cpp Fri Jan 20 10:14:22 2012
@@ -408,3 +408,10 @@
 };
 
 }
+
+namespace PR11784 {
+  struct A { A& operator=(void (*x)()); };
+  void f();
+  void f(int);
+  void g() { A x; x = f; }
+}

Modified: cfe/branches/tooling/test/SemaCXX/typedef-redecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/typedef-redecl.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/typedef-redecl.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/typedef-redecl.cpp Fri Jan 20 10:14:22 2012
@@ -59,3 +59,37 @@
 typedef T f(T t) { return t; } // expected-error {{function definition declared 'typedef'}}
 int k = f(0);
 int k2 = k;
+
+namespace PR11630 {
+  template <class T>
+  struct S
+  {
+    static const unsigned C = 1;
+    static void f()
+    {
+      typedef int q[C == 1 ? 1 : -1]; // expected-note{{previous definition is here}}
+      typedef int q[C >= 1 ? 2 : -2]; // expected-error{{typedef redefinition with different types ('int [2]' vs 'int [1]')}}
+      typedef int n[C == 1 ? 1 : -1];
+      typedef int n[C >= 1 ? 1 : -1];
+    }
+  };
+
+  template <int T>
+  struct S2
+  {
+    static void f()
+    {
+      typedef int q[1];  // expected-note{{previous definition is here}}
+      typedef int q[T];  // expected-error{{typedef redefinition with different types ('int [2]' vs 'int [1]')}}
+    }
+  };
+
+  void f() {
+    S<int> a;
+    a.f(); // expected-note{{in instantiation of member function 'PR11630::S<int>::f' requested here}}
+    S2<1> b;
+    b.f();
+    S2<2> b2;
+    b2.f(); // expected-note{{in instantiation of member function 'PR11630::S2<2>::f' requested here}}
+  }
+}

Modified: cfe/branches/tooling/test/SemaCXX/typo-correction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/typo-correction.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/typo-correction.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/typo-correction.cpp Fri Jan 20 10:14:22 2012
@@ -29,3 +29,72 @@
 inline error_condition make_error_condition(errc _e) {
   return error_condition(static_cast<int>(_e));
 }
+
+
+// Prior to the introduction of a callback object to further filter possible
+// typo corrections, this example would not trigger a suggestion as "base_type"
+// is a closer match to "basetype" than is "BaseType" but "base_type" does not
+// refer to a base class or non-static data member.
+struct BaseType { };
+struct Derived : public BaseType { // expected-note {{base class 'BaseType' specified here}}
+  static int base_type; // expected-note {{'base_type' declared here}}
+  Derived() : basetype() {} // expected-error{{initializer 'basetype' does not name a non-static data member or base class; did you mean the base class 'BaseType'?}}
+};
+
+// Test the improvement from passing a callback object to CorrectTypo in
+// the helper function LookupMemberExprInRecord.
+int get_type(struct Derived *st) {
+  return st->Base_Type; // expected-error{{no member named 'Base_Type' in 'Derived'; did you mean 'base_type'?}}
+}
+
+// In this example, somename should not be corrected to the cached correction
+// "some_name" since "some_name" is a class and a namespace name is needed.
+class some_name {}; // expected-note {{'some_name' declared here}}
+somename Foo; // expected-error {{unknown type name 'somename'; did you mean 'some_name'?}}
+namespace SomeName {} // expected-note {{namespace 'SomeName' defined here}}
+using namespace somename; // expected-error {{no namespace named 'somename'; did you mean 'SomeName'?}}
+
+
+// Without the callback object, CorrectTypo would choose "field1" as the
+// correction for "fielda" as it is closer than "FieldA", but that correction
+// would be later discarded by the caller and no suggestion would be given.
+struct st {
+  struct {
+    int field1;
+  };
+  double FieldA; // expected-note{{'FieldA' declared here}}
+};
+st var = { .fielda = 0.0 }; // expected-error{{field designator 'fielda' does not refer to any field in type 'st'; did you mean 'FieldA'?}}
+
+// Test the improvement from passing a callback object to CorrectTypo in
+// Sema::BuildCXXNestedNameSpecifier. And also for the improvement by doing
+// so in Sema::getTypeName.
+typedef char* another_str; // expected-note{{'another_str' declared here}}
+namespace AnotherStd { // expected-note{{'AnotherStd' declared here}}
+  class string {};
+}
+another_std::string str; // expected-error{{use of undeclared identifier 'another_std'; did you mean 'AnotherStd'?}}
+another_str *cstr = new AnotherStr; // expected-error{{unknown type name 'AnotherStr'; did you mean 'another_str'?}}
+
+// Test the improvement from passing a callback object to CorrectTypo in
+// Sema::ActOnSizeofParameterPackExpr.
+char* TireNames;
+template<typename ...TypeNames> struct count { // expected-note{{parameter pack 'TypeNames' declared here}}
+  static const unsigned value = sizeof...(TyreNames); // expected-error{{'TyreNames' does not refer to the name of a parameter pack; did you mean 'TypeNames'?}}
+};
+
+// Test the typo-correction callback in Sema::DiagnoseUnknownTypeName.
+namespace unknown_type_test {
+  class StreamOut {}; // expected-note{{'StreamOut' declared here}}
+  long stream_count;
+};
+unknown_type_test::stream_out out; // expected-error{{no type named 'stream_out' in namespace 'unknown_type_test'; did you mean 'StreamOut'?}}
+
+// Test the typo-correction callback in Sema::DiagnoseInvalidRedeclaration.
+struct BaseDecl {
+  void add_in(int i);
+};
+struct TestRedecl : public BaseDecl {
+  void add_it(int i); // expected-note{{'add_it' declared here}}
+};
+void TestRedecl::add_in(int i) {} // expected-error{{out-of-line definition of 'add_in' does not match any declaration in 'TestRedecl'; did you mean 'add_it'?}}

Modified: cfe/branches/tooling/test/SemaCXX/uninitialized.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/uninitialized.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/uninitialized.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/uninitialized.cpp Fri Jan 20 10:14:22 2012
@@ -41,6 +41,7 @@
     A(int x) {}
     A(int *x) {}
     A(A *a) {}
+    ~A();
 };
 
 A getA() { return A(); }

Modified: cfe/branches/tooling/test/SemaCXX/warn-large-by-value-copy.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/warn-large-by-value-copy.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/warn-large-by-value-copy.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/warn-large-by-value-copy.cpp Fri Jan 20 10:14:22 2012
@@ -40,3 +40,8 @@
 }
 
 }
+
+template<typename T> class DependentPOD {
+  enum b { x };
+  b foo() { return x; }
+};

Modified: cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/warn-thread-safety-analysis.cpp Fri Jan 20 10:14:22 2012
@@ -1605,3 +1605,126 @@
 } // end namespace test_scoped_lockable
 
 
+
+namespace FunctionAttrTest {
+
+class Foo {
+public:
+  Mutex mu_;
+  int a GUARDED_BY(mu_);
+};
+
+Foo fooObj;
+
+void foo() EXCLUSIVE_LOCKS_REQUIRED(fooObj.mu_);
+
+void bar() {
+  foo();  // expected-warning {{calling function 'foo' requires exclusive lock on 'mu_'}}
+  fooObj.mu_.Lock();
+  foo();
+  fooObj.mu_.Unlock();
+}
+
+};  // end namespace FunctionAttrTest
+
+
+struct TestTryLock {
+  Mutex mu;
+  int a GUARDED_BY(mu);
+  bool cond;
+
+  void foo1() {
+    if (mu.TryLock()) {
+      a = 1;
+      mu.Unlock();
+    }
+  }
+
+  void foo2() {
+    if (!mu.TryLock()) return;
+    a = 2;
+    mu.Unlock();
+  }
+
+  void foo3() {
+    bool b = mu.TryLock();
+    if (b) {
+      a = 3;
+      mu.Unlock();
+    }
+  }
+
+  void foo4() {
+    bool b = mu.TryLock();
+    if (!b) return;
+    a = 4;
+    mu.Unlock();
+  }
+
+  void foo5() {
+    while (mu.TryLock()) {
+      a = a + 1;
+      mu.Unlock();
+    }
+  }
+
+  void foo6() {
+    bool b = mu.TryLock();
+    b = !b;
+    if (b) return;
+    a = 6;
+    mu.Unlock();
+  }
+
+  void foo7() {
+    bool b1 = mu.TryLock();
+    bool b2 = !b1;
+    bool b3 = !b2;
+    if (b3) {
+      a = 7;
+      mu.Unlock();
+    }
+  }
+
+  // Test use-def chains: join points
+  void foo8() {
+    bool b  = mu.TryLock();
+    bool b2 = b;
+    if (cond)
+      b = true;
+    if (b) {    // b should be unknown at this point, becuase of the join point
+      a = 8;    // expected-warning {{writing variable 'a' requires locking 'mu' exclusively}}
+    }
+    if (b2) {   // b2 should be known at this point.
+      a = 8;
+      mu.Unlock();
+    }
+  }
+
+  // Test use-def-chains: back edges
+  void foo9() {
+    bool b = mu.TryLock();
+
+    for (int i = 0; i < 10; ++i);
+
+    if (b) {  // b is still known, because the loop doesn't alter it
+      a = 9;
+      mu.Unlock();
+    }
+  }
+
+  // Test use-def chains: back edges
+  void foo10() {
+    bool b = mu.TryLock();
+
+    while (cond) {
+      if (b) {   // b should be uknown at this point b/c of the loop
+        a = 10;  // expected-warning {{writing variable 'a' requires locking 'mu' exclusively}}
+      }
+      b = !b;
+    }
+  }
+};  // end TestTrylock
+
+
+

Propchange: cfe/branches/tooling/test/SemaCXX/warn-unreachable.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 20 10:14:22 2012
@@ -1,2 +1,2 @@
 /cfe/branches/type-system-rewrite/test/SemaCXX/warn-unreachable.cpp:134693-134817
-/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961
+/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,146581-148539

Modified: cfe/branches/tooling/test/SemaCXX/warn-unused-variables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/warn-unused-variables.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/warn-unused-variables.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/warn-unused-variables.cpp Fri Jan 20 10:14:22 2012
@@ -80,3 +80,45 @@
     f<char>(); // expected-note {{here}}
   }
 }
+
+namespace PR11550 {
+  struct S1 {
+    S1();
+  };
+  S1 makeS1();
+  void testS1(S1 a) {
+    // This constructor call can be elided.
+    S1 x = makeS1(); // expected-warning {{unused variable 'x'}}
+
+    // This one cannot, so no warning.
+    S1 y;
+
+    // This call cannot, but the constructor is trivial.
+    S1 z = a; // expected-warning {{unused variable 'z'}}
+  }
+
+  // The same is true even when we know thet constructor has side effects.
+  void foo();
+  struct S2 {
+    S2() {
+      foo();
+    }
+  };
+  S2 makeS2();
+  void testS2(S2 a) {
+    S2 x = makeS2(); // expected-warning {{unused variable 'x'}}
+    S2 y;
+    S2 z = a; // expected-warning {{unused variable 'z'}}
+  }
+
+  // Or when the constructor is not declared by the user.
+  struct S3 {
+    S1 m;
+  };
+  S3 makeS3();
+  void testS3(S3 a) {
+    S3 x = makeS3(); // expected-warning {{unused variable 'x'}}
+    S3 y;
+    S3 z = a; // expected-warning {{unused variable 'z'}}
+  }
+}

Modified: cfe/branches/tooling/test/SemaObjC/ContClassPropertyLookup.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/ContClassPropertyLookup.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/ContClassPropertyLookup.m (original)
+++ cfe/branches/tooling/test/SemaObjC/ContClassPropertyLookup.m Fri Jan 20 10:14:22 2012
@@ -16,3 +16,23 @@
 @implementation MyObject
 @synthesize foo = _foo;
 @end
+
+// rdar://10666594
+ at interface MPMediaItem
+ at end
+
+ at class MPMediaItem;
+
+ at interface MPMediaItem ()
+ at property (nonatomic, readonly) id title;
+ at end
+
+ at interface PodcastEpisodesViewController
+ at end
+
+ at implementation PodcastEpisodesViewController
+- (id) Meth {
+    MPMediaItem *episode;
+    return episode.title;
+}
+ at end

Modified: cfe/branches/tooling/test/SemaObjC/DoubleMethod.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/DoubleMethod.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/DoubleMethod.m (original)
+++ cfe/branches/tooling/test/SemaObjC/DoubleMethod.m Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -Wduplicate-method-match -fsyntax-only -verify %s
 
 @interface Subclass
 {

Modified: cfe/branches/tooling/test/SemaObjC/arc-bridged-cast.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/arc-bridged-cast.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/arc-bridged-cast.m (original)
+++ cfe/branches/tooling/test/SemaObjC/arc-bridged-cast.m Fri Jan 20 10:14:22 2012
@@ -1,5 +1,4 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -verify %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fblocks %s
 
 typedef const void *CFTypeRef;
 typedef const struct __CFString *CFStringRef;

Modified: cfe/branches/tooling/test/SemaObjC/arc-property-lifetime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/arc-property-lifetime.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/arc-property-lifetime.m (original)
+++ cfe/branches/tooling/test/SemaObjC/arc-property-lifetime.m Fri Jan 20 10:14:22 2012
@@ -125,3 +125,46 @@
 @synthesize controllerClass = _controllerClass;
 @synthesize controllerId = _controllerId;
 @end
+
+// rdar://10630891
+ at interface UIView @end
+ at class UIColor;
+
+ at interface UIView(UIViewRendering)
+ at property(nonatomic,copy) UIColor *backgroundColor;
+ at end
+
+ at interface UILabel : UIView
+ at end
+
+ at interface MyView 
+ at property (strong) UILabel *label;
+ at end
+
+ at interface MyView2 : MyView @end
+
+ at implementation MyView2
+- (void)foo {
+  super.label.backgroundColor = 0;
+}
+ at end
+
+// rdar://10694932
+ at interface Baz 
+ at property  id prop;
+ at property  __strong id strong_prop;
+ at property  (strong) id strong_attr_prop;
+ at property  (strong) __strong id realy_strong_attr_prop;
++ (id) alloc;
+- (id) init;
+- (id) implicit;
+- (void) setImplicit : (id) arg; 
+ at end
+
+void foo(Baz *f) {
+        f.prop = [[Baz alloc] init];
+        f.strong_prop = [[Baz alloc] init];
+        f.strong_attr_prop = [[Baz alloc] init];
+        f.realy_strong_attr_prop = [[Baz alloc] init];
+        f.implicit = [[Baz alloc] init];
+}

Modified: cfe/branches/tooling/test/SemaObjC/check-dup-decl-methods-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/check-dup-decl-methods-1.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/check-dup-decl-methods-1.m (original)
+++ cfe/branches/tooling/test/SemaObjC/check-dup-decl-methods-1.m Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -Wduplicate-method-match -fsyntax-only -verify %s
 
 @interface SUPER
 - (int) meth;

Modified: cfe/branches/tooling/test/SemaObjC/class-conforming-protocol-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/class-conforming-protocol-1.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/class-conforming-protocol-1.m (original)
+++ cfe/branches/tooling/test/SemaObjC/class-conforming-protocol-1.m Fri Jan 20 10:14:22 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -Wduplicate-method-match -fsyntax-only -verify %s
 
 @protocol P1 @end
 @protocol P2 @end

Modified: cfe/branches/tooling/test/SemaObjC/continuation-class-property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/continuation-class-property.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/continuation-class-property.m (original)
+++ cfe/branches/tooling/test/SemaObjC/continuation-class-property.m Fri Jan 20 10:14:22 2012
@@ -41,3 +41,23 @@
 @property (readwrite) NSString *foo; // expected-error {{type of property 'NSString *' in continuation class does not match property type in primary class}}
 @property (readwrite, strong) NSRect bar; // expected-error {{type of property 'NSRect' in continuation class does not match property type in primary class}}
 @end
+
+// rdar://10655530
+struct S;
+struct S1;
+ at interface STAdKitContext
+ at property (nonatomic, readonly, assign) struct evhttp_request *httpRequest;
+ at property (nonatomic, readonly, assign) struct S *httpRequest2;
+ at property (nonatomic, readonly, assign) struct S1 *httpRequest3;
+ at property (nonatomic, readonly, assign) struct S2 *httpRequest4;
+ at end
+
+struct evhttp_request;
+struct S1;
+
+ at interface STAdKitContext()
+ at property (nonatomic, readwrite, assign) struct evhttp_request *httpRequest;
+ at property (nonatomic, readwrite, assign) struct S *httpRequest2;
+ at property (nonatomic, readwrite, assign) struct S1 *httpRequest3;
+ at property (nonatomic, readwrite, assign) struct S2 *httpRequest4;
+ at end

Modified: cfe/branches/tooling/test/SemaObjC/format-strings-objc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/format-strings-objc.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/format-strings-objc.m (original)
+++ cfe/branches/tooling/test/SemaObjC/format-strings-objc.m Fri Jan 20 10:14:22 2012
@@ -63,3 +63,22 @@
   printf("%p", y); // no-warning
 }
 
+// <rdar://problem/10696348>, PR 10274 - CFString and NSString formats are ignored
+extern void MyNSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
+extern void MyCFStringCreateWithFormat(CFStringRef format, ...) __attribute__((format(__CFString__, 1, 2)));
+
+void check_mylog() {
+  MyNSLog(@"%@"); // expected-warning {{more '%' conversions than data arguments}}
+  // FIXME: find a way to test CFString too, but I don't know how to create constant CFString.
+}
+
+// PR 10275 - format function attribute isn't checked in Objective-C methods
+ at interface Foo
++ (id)fooWithFormat:(NSString *)fmt, ... __attribute__((format(__NSString__, 1, 2)));
++ (id)fooWithCStringFormat:(const char *)format, ... __attribute__((format(__printf__, 1, 2)));
+ at end
+
+void check_method() {
+  [Foo fooWithFormat:@"%@"]; // expected-warning {{more '%' conversions than data arguments}}
+  [Foo fooWithCStringFormat:"%@"]; // expected-warning {{invalid conversion specifier '@'}}
+}

Modified: cfe/branches/tooling/test/SemaObjC/id-isa-ref.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/id-isa-ref.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/id-isa-ref.m (original)
+++ cfe/branches/tooling/test/SemaObjC/id-isa-ref.m Fri Jan 20 10:14:22 2012
@@ -16,8 +16,9 @@
  
   id x;
 
-  [(*x).isa self];
-  [x->isa self];
+  // rdar://8290002
+  [(*x).isa self]; // expected-warning {{direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()}}
+  [x->isa self]; // expected-warning {{direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()}}
   
   Whatever *y;
 

Modified: cfe/branches/tooling/test/SemaObjC/property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/property.m?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/property.m (original)
+++ cfe/branches/tooling/test/SemaObjC/property.m Fri Jan 20 10:14:22 2012
@@ -74,3 +74,10 @@
 + (float) globalValue { return 5.0f; }
 + (float) gv { return test6_getClass().globalValue; }
 @end
+
+ at interface Test7
+ at property unsigned length;
+ at end
+void test7(Test7 *t) {
+  char data[t.length] = {}; // expected-error {{variable-sized object may not be initialized}}
+}

Modified: cfe/branches/tooling/test/SemaObjCXX/arc-type-traits.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjCXX/arc-type-traits.mm?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjCXX/arc-type-traits.mm (original)
+++ cfe/branches/tooling/test/SemaObjCXX/arc-type-traits.mm Fri Jan 20 10:14:22 2012
@@ -53,16 +53,16 @@
 TRAIT_IS_TRUE(__has_trivial_destructor, __unsafe_unretained id);
 
 // __is_literal
-TRAIT_IS_FALSE(__is_literal, __strong id);
-TRAIT_IS_FALSE(__is_literal, __weak id);
-TRAIT_IS_FALSE(__is_literal, __autoreleasing id);
-TRAIT_IS_FALSE(__is_literal, __unsafe_unretained id);
+TRAIT_IS_TRUE(__is_literal, __strong id);
+TRAIT_IS_TRUE(__is_literal, __weak id);
+TRAIT_IS_TRUE(__is_literal, __autoreleasing id);
+TRAIT_IS_TRUE(__is_literal, __unsafe_unretained id);
 
 // __is_literal_type
-TRAIT_IS_FALSE(__is_literal_type, __strong id);
-TRAIT_IS_FALSE(__is_literal_type, __weak id);
-TRAIT_IS_FALSE(__is_literal_type, __autoreleasing id);
-TRAIT_IS_FALSE(__is_literal_type, __unsafe_unretained id);
+TRAIT_IS_TRUE(__is_literal_type, __strong id);
+TRAIT_IS_TRUE(__is_literal_type, __weak id);
+TRAIT_IS_TRUE(__is_literal_type, __autoreleasing id);
+TRAIT_IS_TRUE(__is_literal_type, __unsafe_unretained id);
 
 // __is_pod
 TRAIT_IS_FALSE(__is_pod, __strong id);

Modified: cfe/branches/tooling/test/SemaObjCXX/instantiate-expr.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjCXX/instantiate-expr.mm?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjCXX/instantiate-expr.mm (original)
+++ cfe/branches/tooling/test/SemaObjCXX/instantiate-expr.mm Fri Jan 20 10:14:22 2012
@@ -20,10 +20,11 @@
 void f(U value, V value2) {
   get_an_A(N)->ivar = value; // expected-error{{assigning to 'int' from incompatible type 'int *'}}
   get_an_A(N).prop = value2; // expected-error{{assigning to 'int' from incompatible type 'double *'}}
-  T c = get_an_id(N)->isa; // expected-error{{cannot initialize a variable of type 'int' with an lvalue of type 'Class'}}
+  T c = get_an_id(N)->isa; // expected-error{{cannot initialize a variable of type 'int' with an lvalue of type 'Class'}} \
+                           // expected-warning 5 {{direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()}}
 }
 
-template void f<6, Class>(int, int);
+template void f<6, Class>(int, int); // expected-note{{in instantiation of}}
 template void f<7, Class>(int*, int); // expected-note{{in instantiation of}}
 template void f<8, Class>(int, double*); // expected-note{{in instantiation of}}
 template void f<9, int>(int, int); // expected-note{{in instantiation of}}
@@ -44,10 +45,11 @@
 // an isa.
 template<typename T, typename U>
 void f3(U ptr) {
-  T c = ptr->isa; // expected-error{{cannot initialize a variable of type 'int' with an lvalue of type 'Class'}}
+  T c = ptr->isa; // expected-error{{cannot initialize a variable of type 'int' with an lvalue of type 'Class'}} \
+                  // expected-warning 2 {{direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()}}
 }
 
-template void f3<Class>(id);
+template void f3<Class>(id); // expected-note{{in instantiation of}}
 template void f3<int>(id); // expected-note{{instantiation of}}
 
 // Implicit setter/getter

Modified: cfe/branches/tooling/test/SemaObjCXX/properties.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjCXX/properties.mm?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjCXX/properties.mm (original)
+++ cfe/branches/tooling/test/SemaObjCXX/properties.mm Fri Jan 20 10:14:22 2012
@@ -31,3 +31,40 @@
   auto y = a.y; // expected-error {{expected getter method not found on object of type 'Test2 *'}} expected-error {{variable 'y' with type 'auto' has incompatible initializer of type}}
   auto z = a.z;
 }
+
+// rdar://problem/10672108
+ at interface Test3
+- (int) length;
+ at end
+void test3(Test3 *t) {
+  char vla[t.length] = {}; // expected-error {{variable-sized object may not be initialized}}
+  char *heaparray = new char[t.length];
+}
+
+// <rdar://problem/10672501>
+namespace std {
+  template<typename T> void count();
+}
+
+ at interface Test4
+- (X&) prop;
+ at end
+
+void test4(Test4 *t) {
+  (void)const_cast<const X&>(t.prop);
+  (void)dynamic_cast<X&>(t.prop);
+  (void)reinterpret_cast<int&>(t.prop);
+}
+
+ at interface Test5 {
+ at public
+  int count;
+}
+ at property int count;
+ at end
+
+void test5(Test5* t5) {
+  if (t5.count < 2) { }
+  if (t5->count < 2) { }
+}
+

Modified: cfe/branches/tooling/test/SemaObjCXX/property-reference.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjCXX/property-reference.mm?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjCXX/property-reference.mm (original)
+++ cfe/branches/tooling/test/SemaObjCXX/property-reference.mm Fri Jan 20 10:14:22 2012
@@ -8,7 +8,7 @@
 	TCPPObject();
 	~TCPPObject();
 	
-	TCPPObject& operator=(const TCPPObject& inObj)const ;
+	TCPPObject& operator=(const TCPPObject& inObj)const ; // expected-note {{'operator=' declared here}}
 
 	void* Data();
 	
@@ -29,7 +29,7 @@
 @implementation TNSObject
 
 @synthesize cppObjectNonAtomic;
- at synthesize cppObjectAtomic; // expected-warning{{atomic property of type 'CREF_TCPPObject' (aka 'const TCPPObject &') synthesizing setter using non-trivial assignment operator}}
+ at synthesize cppObjectAtomic; // expected-error{{atomic property of reference type 'CREF_TCPPObject' (aka 'const TCPPObject &') cannot have non-trivial assignment operator}}
 @dynamic cppObjectDynamic;
 
 - (const TCPPObject&) cppObjectNonAtomic

Modified: cfe/branches/tooling/test/SemaObjCXX/property-synthesis-error.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjCXX/property-synthesis-error.mm?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjCXX/property-synthesis-error.mm (original)
+++ cfe/branches/tooling/test/SemaObjCXX/property-synthesis-error.mm Fri Jan 20 10:14:22 2012
@@ -38,7 +38,7 @@
  TCPPObject(const TCPPObject& inObj);
  TCPPObject();
  ~TCPPObject();
- TCPPObject& operator=(const TCPPObject& inObj);
+ TCPPObject& operator=(const TCPPObject& inObj); // expected-note {{'operator=' declared here}}
 private:
  void* fData;
 };
@@ -67,7 +67,7 @@
 
 @implementation MyDocument
 
- at synthesize cppObject = _cppObject; // expected-warning {{atomic property of type 'const TCPPObject &' synthesizing setter using non-trivial assignment operator}}
+ at synthesize cppObject = _cppObject; // expected-error {{atomic property of reference type 'const TCPPObject &' cannot have non-trivial assignment operator}}
 @synthesize ncppObject = _ncppObject;
 
 @synthesize tcppObject = _tcppObject;

Modified: cfe/branches/tooling/test/SemaTemplate/class-template-ctor-initializer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/class-template-ctor-initializer.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/class-template-ctor-initializer.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/class-template-ctor-initializer.cpp Fri Jan 20 10:14:22 2012
@@ -49,7 +49,7 @@
   int
   main (void)
   {
-    Final final();
+    Final final;
     return 0;
   }
 }

Modified: cfe/branches/tooling/test/SemaTemplate/class-template-spec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/class-template-spec.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/class-template-spec.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/class-template-spec.cpp Fri Jan 20 10:14:22 2012
@@ -86,7 +86,7 @@
 
 template<> struct N::B<int> { }; // okay
 
-template<> struct N::B<float> { }; // expected-warning{{originally}}
+template<> struct N::B<float> { }; // expected-warning{{C++11 extension}}
 
 namespace M {
   template<> struct ::N::B<short> { }; // expected-error{{class template specialization of 'B' not in a namespace enclosing 'N'}}

Modified: cfe/branches/tooling/test/SemaTemplate/explicit-instantiation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/explicit-instantiation.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/explicit-instantiation.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/explicit-instantiation.cpp Fri Jan 20 10:14:22 2012
@@ -97,3 +97,11 @@
   // expected-error{{expected member name or ';' after declaration specifiers}}
   template struct basic_streambuf<int>;
 }
+
+// Test that we do not crash.
+class TC1 {
+  class TC2 {
+    template // FIXME: error here.
+    void foo() { }
+   };
+};

Modified: cfe/branches/tooling/test/SemaTemplate/instantiate-declref-ice.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/instantiate-declref-ice.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/instantiate-declref-ice.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/instantiate-declref-ice.cpp Fri Jan 20 10:14:22 2012
@@ -31,4 +31,4 @@
 template<typename T>
 const unsigned X1<T>::value = sizeof(T);
 
-int array3[X1<int>::value == sizeof(int)? 1 : -1]; // expected-error{{variable length array declaration not allowed at file scope}}
+int array3[X1<int>::value == sizeof(int)? 1 : -1];

Modified: cfe/branches/tooling/test/SemaTemplate/instantiate-expr-1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/instantiate-expr-1.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/instantiate-expr-1.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/instantiate-expr-1.cpp Fri Jan 20 10:14:22 2012
@@ -34,7 +34,7 @@
 
 template<int I, int J>
 struct BitfieldDivide {
-  int bitfield : I / J; // expected-error{{expression is not an integer constant expression}} \
+  int bitfield : I / J; // expected-error{{expression is not an integral constant expression}} \
                         // expected-note{{division by zero}}
 };
 

Modified: cfe/branches/tooling/test/SemaTemplate/instantiate-static-var.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/instantiate-static-var.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/instantiate-static-var.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/instantiate-static-var.cpp Fri Jan 20 10:14:22 2012
@@ -2,7 +2,7 @@
 template<typename T, T Divisor>
 class X {
 public:
-  static const T value = 10 / Divisor; // expected-error{{in-class initializer is not a constant expression}}
+  static const T value = 10 / Divisor; // expected-error{{in-class initializer for static data member is not a constant expression}}
 };
 
 int array1[X<int, 2>::value == 5? 1 : -1];
@@ -114,4 +114,3 @@
   template class X1<char>;
 
 }
-

Modified: cfe/branches/tooling/test/SemaTemplate/temp_class_spec_neg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/temp_class_spec_neg.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/temp_class_spec_neg.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/temp_class_spec_neg.cpp Fri Jan 20 10:14:22 2012
@@ -9,7 +9,7 @@
 }
 
 template<typename T>
-struct N::M::A<T*> { }; // expected-warning{{originally}}
+struct N::M::A<T*> { }; // expected-warning{{C++11 extension}}
 
 // C++ [temp.class.spec]p9
 //   bullet 1

Modified: cfe/branches/tooling/tools/arcmt-test/arcmt-test.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/arcmt-test/arcmt-test.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/arcmt-test/arcmt-test.cpp (original)
+++ cfe/branches/tooling/tools/arcmt-test/arcmt-test.cpp Fri Jan 20 10:14:22 2012
@@ -118,7 +118,8 @@
   }
 
   CompilerInvocation CI;
-  CompilerInvocation::CreateFromArgs(CI, Args.begin(), Args.end(), *Diags);
+  if (!CompilerInvocation::CreateFromArgs(CI, Args.begin(), Args.end(), *Diags))
+    return true;
 
   if (CI.getFrontendOpts().Inputs.empty()) {
     llvm::errs() << "error: no input files\n";
@@ -159,8 +160,9 @@
       new DiagnosticsEngine(DiagID, DiagClient));
 
   CompilerInvocation origCI;
-  CompilerInvocation::CreateFromArgs(origCI, Args.begin(), Args.end(),
-                                     *TopDiags);
+  if (!CompilerInvocation::CreateFromArgs(origCI, Args.begin(), Args.end(),
+                                     *TopDiags))
+    return true;
 
   if (origCI.getFrontendOpts().Inputs.empty()) {
     llvm::errs() << "error: no input files\n";

Modified: cfe/branches/tooling/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/c-index-test/c-index-test.c?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/c-index-test/c-index-test.c (original)
+++ cfe/branches/tooling/tools/c-index-test/c-index-test.c Fri Jan 20 10:14:22 2012
@@ -1911,6 +1911,17 @@
   index_indexEntityReference
 };
 
+static unsigned getIndexOptions(void) {
+  unsigned index_opts;
+  index_opts = 0;
+  if (getenv("CINDEXTEST_SUPPRESSREFS"))
+    index_opts |= CXIndexOpt_SuppressRedundantRefs;
+  if (getenv("CINDEXTEST_INDEXLOCALSYMBOLS"))
+    index_opts |= CXIndexOpt_IndexFunctionLocalSymbols;
+
+  return index_opts;
+}
+
 static int index_file(int argc, const char **argv) {
   const char *check_prefix;
   CXIndex Idx;
@@ -1946,10 +1957,7 @@
   index_data.fail_for_error = 0;
   index_data.abort = 0;
 
-  index_opts = 0;
-  if (getenv("CINDEXTEST_SUPPRESSREFS"))
-    index_opts |= CXIndexOpt_SuppressRedundantRefs;
-
+  index_opts = getIndexOptions();
   idxAction = clang_IndexAction_create(Idx);
   result = clang_indexSourceFile(idxAction, &index_data,
                                  &IndexCB,sizeof(IndexCB), index_opts,
@@ -2001,10 +2009,7 @@
   index_data.fail_for_error = 0;
   index_data.abort = 0;
 
-  index_opts = 0;
-  if (getenv("CINDEXTEST_SUPPRESSREFS"))
-    index_opts |= CXIndexOpt_SuppressRedundantRefs;
-
+  index_opts = getIndexOptions();
   idxAction = clang_IndexAction_create(Idx);
   result = clang_indexTranslationUnit(idxAction, &index_data,
                                       &IndexCB,sizeof(IndexCB),

Modified: cfe/branches/tooling/tools/driver/cc1_main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/driver/cc1_main.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/driver/cc1_main.cpp (original)
+++ cfe/branches/tooling/tools/driver/cc1_main.cpp Fri Jan 20 10:14:22 2012
@@ -77,7 +77,8 @@
   // Create a compiler invocation.
   llvm::errs() << "cc1 creating invocation.\n";
   CompilerInvocation Invocation;
-  CompilerInvocation::CreateFromArgs(Invocation, ArgBegin, ArgEnd, Diags);
+  if (!CompilerInvocation::CreateFromArgs(Invocation, ArgBegin, ArgEnd, Diags))
+    return 1;
 
   // Convert the invocation back to argument strings.
   std::vector<std::string> InvocationArgs;
@@ -95,8 +96,9 @@
   // Convert those arguments to another invocation, and check that we got the
   // same thing.
   CompilerInvocation Invocation2;
-  CompilerInvocation::CreateFromArgs(Invocation2, Invocation2Args.begin(),
-                                     Invocation2Args.end(), Diags);
+  if (!CompilerInvocation::CreateFromArgs(Invocation2, Invocation2Args.begin(),
+                                          Invocation2Args.end(), Diags))
+    return 1;
 
   // FIXME: Implement CompilerInvocation comparison.
   if (true) {
@@ -135,8 +137,11 @@
   // well formed diagnostic object.
   TextDiagnosticBuffer *DiagsBuffer = new TextDiagnosticBuffer;
   DiagnosticsEngine Diags(DiagID, DiagsBuffer);
-  CompilerInvocation::CreateFromArgs(Clang->getInvocation(), ArgBegin, ArgEnd,
-                                     Diags);
+  bool Success;
+  Success = CompilerInvocation::CreateFromArgs(Clang->getInvocation(),
+                                               ArgBegin, ArgEnd, Diags);
+  if (!Success)
+    return 1;
 
   // Infer the builtin include path if unspecified.
   if (Clang->getHeaderSearchOpts().UseBuiltinIncludes &&
@@ -157,7 +162,7 @@
   DiagsBuffer->FlushDiagnostics(Clang->getDiagnostics());
 
   // Execute the frontend actions.
-  bool Success = ExecuteCompilerInvocation(Clang.get());
+  Success = ExecuteCompilerInvocation(Clang.get());
 
   // If any timers were active but haven't been destroyed yet, print their
   // results now.  This happens in -disable-free mode.

Modified: cfe/branches/tooling/tools/driver/cc1as_main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/driver/cc1as_main.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/driver/cc1as_main.cpp (original)
+++ cfe/branches/tooling/tools/driver/cc1as_main.cpp Fri Jan 20 10:14:22 2012
@@ -72,6 +72,8 @@
   std::vector<std::string> IncludePaths;
   unsigned NoInitialTextSection : 1;
   unsigned SaveTemporaryLabels : 1;
+  unsigned GenDwarfForAssembly : 1;
+  std::string DwarfDebugFlags;
 
   /// @}
   /// @name Frontend Options
@@ -120,17 +122,19 @@
     NoExecStack = 0;
   }
 
-  static void CreateFromArgs(AssemblerInvocation &Res, const char **ArgBegin,
+  static bool CreateFromArgs(AssemblerInvocation &Res, const char **ArgBegin,
                              const char **ArgEnd, DiagnosticsEngine &Diags);
 };
 
 }
 
-void AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
+bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
                                          const char **ArgBegin,
                                          const char **ArgEnd,
                                          DiagnosticsEngine &Diags) {
   using namespace clang::driver::cc1asoptions;
+  bool Success = true;
+
   // Parse the arguments.
   OwningPtr<OptTable> OptTbl(createCC1AsOptTable());
   unsigned MissingArgIndex, MissingArgCount;
@@ -138,14 +142,18 @@
     OptTbl->ParseArgs(ArgBegin, ArgEnd,MissingArgIndex, MissingArgCount));
 
   // Check for missing argument error.
-  if (MissingArgCount)
+  if (MissingArgCount) {
     Diags.Report(diag::err_drv_missing_argument)
       << Args->getArgString(MissingArgIndex) << MissingArgCount;
+    Success = false;
+  }
 
   // Issue errors on unknown arguments.
   for (arg_iterator it = Args->filtered_begin(cc1asoptions::OPT_UNKNOWN),
-         ie = Args->filtered_end(); it != ie; ++it)
+         ie = Args->filtered_end(); it != ie; ++it) {
     Diags.Report(diag::err_drv_unknown_argument) << (*it) ->getAsString(*Args);
+    Success = false;
+  }
 
   // Construct the invocation.
 
@@ -158,6 +166,8 @@
   Opts.IncludePaths = Args->getAllArgValues(OPT_I);
   Opts.NoInitialTextSection = Args->hasArg(OPT_n);
   Opts.SaveTemporaryLabels = Args->hasArg(OPT_L);
+  Opts.GenDwarfForAssembly = Args->hasArg(OPT_g);
+  Opts.DwarfDebugFlags = Args->getLastArgValue(OPT_dwarf_debug_flags);
 
   // Frontend Options
   if (Args->hasArg(OPT_INPUT)) {
@@ -167,8 +177,10 @@
       const Arg *A = it;
       if (First)
         Opts.InputFile = A->getValue(*Args);
-      else
+      else {
         Diags.Report(diag::err_drv_unknown_argument) << A->getAsString(*Args);
+        Success = false;
+      }
     }
   }
   Opts.LLVMArgs = Args->getAllArgValues(OPT_mllvm);
@@ -182,10 +194,11 @@
       .Case("null", FT_Null)
       .Case("obj", FT_Obj)
       .Default(~0U);
-    if (OutputType == ~0U)
+    if (OutputType == ~0U) {
       Diags.Report(diag::err_drv_invalid_value)
         << A->getAsString(*Args) << Name;
-    else
+      Success = false;
+    } else
       Opts.OutputType = FileType(OutputType);
   }
   Opts.ShowHelp = Args->hasArg(OPT_help);
@@ -200,6 +213,8 @@
   // Assemble Options
   Opts.RelaxAll = Args->hasArg(OPT_relax_all);
   Opts.NoExecStack =  Args->hasArg(OPT_no_exec_stack);
+
+  return Success;
 }
 
 static formatted_raw_ostream *GetOutputStream(AssemblerInvocation &Opts,
@@ -273,6 +288,10 @@
                              Reloc::Default, CodeModel::Default, Ctx);
   if (Opts.SaveTemporaryLabels)
     Ctx.setAllowTemporaryLabels(false);
+  if (Opts.GenDwarfForAssembly)
+    Ctx.setGenDwarfForAssembly(true);
+  if (!Opts.DwarfDebugFlags.empty())
+    Ctx.setDwarfDebugFlags(StringRef(Opts.DwarfDebugFlags));
 
   OwningPtr<MCStreamer> Str;
 
@@ -366,7 +385,8 @@
 
   // Parse the arguments.
   AssemblerInvocation Asm;
-  AssemblerInvocation::CreateFromArgs(Asm, ArgBegin, ArgEnd, Diags);
+  if (!AssemblerInvocation::CreateFromArgs(Asm, ArgBegin, ArgEnd, Diags))
+    return 1;
 
   // Honor -help.
   if (Asm.ShowHelp) {

Modified: cfe/branches/tooling/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/driver/driver.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/driver/driver.cpp (original)
+++ cfe/branches/tooling/tools/driver/driver.cpp Fri Jan 20 10:14:22 2012
@@ -22,7 +22,6 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/OwningPtr.h"
-#include "llvm/Config/config.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/ManagedStatic.h"

Modified: cfe/branches/tooling/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CIndex.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CIndex.cpp (original)
+++ cfe/branches/tooling/tools/libclang/CIndex.cpp Fri Jan 20 10:14:22 2012
@@ -181,7 +181,7 @@
     return VisitChildren(Cursor);
   }
 
-  return false;
+  llvm_unreachable("Invalid CXChildVisitResult!");
 }
 
 static bool visitPreprocessedEntitiesInRange(SourceRange R,
@@ -193,8 +193,8 @@
   if (!Visitor.shouldVisitIncludedEntities()) {
     // If the begin/end of the range lie in the same FileID, do the optimization
     // where we skip preprocessed entities that do not come from the same FileID.
-    FID = SM.getFileID(R.getBegin());
-    if (FID != SM.getFileID(R.getEnd()))
+    FID = SM.getFileID(SM.getFileLoc(R.getBegin()));
+    if (FID != SM.getFileID(SM.getFileLoc(R.getEnd())))
       FID = FileID();
   }
 
@@ -297,12 +297,6 @@
 
     CurDC = dyn_cast<DeclContext>(D);
 
-    // We handle forward decls via ObjCClassDecl.
-    if (ObjCInterfaceDecl *InterD = dyn_cast<ObjCInterfaceDecl>(D)) {
-      if (!InterD->isThisDeclarationADefinition())
-        continue;
-    }
-
     if (TagDecl *TD = dyn_cast<TagDecl>(D))
       if (!TD->isFreeStanding())
         continue;
@@ -579,7 +573,6 @@
 
 bool CursorVisitor::VisitTranslationUnitDecl(TranslationUnitDecl *D) {
   llvm_unreachable("Translation units are visited directly by Visit()");
-  return false;
 }
 
 bool CursorVisitor::VisitTypeAliasDecl(TypeAliasDecl *D) {
@@ -957,6 +950,9 @@
 }
 
 bool CursorVisitor::VisitObjCProtocolDecl(ObjCProtocolDecl *PID) {
+  if (!PID->isThisDeclarationADefinition())
+    return Visit(MakeCursorObjCProtocolRef(PID, PID->getLocation(), TU));
+  
   ObjCProtocolDecl::protocol_loc_iterator PL = PID->protocol_loc_begin();
   for (ObjCProtocolDecl::protocol_iterator I = PID->protocol_begin(),
        E = PID->protocol_end(); I != E; ++I, ++PL)
@@ -1004,6 +1000,11 @@
 }
 
 bool CursorVisitor::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) {
+  if (!D->isThisDeclarationADefinition()) {
+    // Forward declaration is treated like a reference.
+    return Visit(MakeCursorObjCClassRef(D, D->getLocation(), TU));
+  }
+
   // Issue callbacks for super class.
   if (D->getSuperClass() &&
       Visit(MakeCursorObjCSuperClassRef(D->getSuperClass(),
@@ -1047,24 +1048,6 @@
   return VisitObjCImplDecl(D);
 }
 
-bool CursorVisitor::VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D) {
-  ObjCForwardProtocolDecl::protocol_loc_iterator PL = D->protocol_loc_begin();
-  for (ObjCForwardProtocolDecl::protocol_iterator I = D->protocol_begin(),
-                                                  E = D->protocol_end();
-       I != E; ++I, ++PL)
-    if (Visit(MakeCursorObjCProtocolRef(*I, *PL, TU)))
-      return true;
-
-  return false;
-}
-
-bool CursorVisitor::VisitObjCClassDecl(ObjCClassDecl *D) {
-  if (Visit(MakeCursorObjCClassRef(D->getForwardInterfaceDecl(), 
-                                   D->getNameLoc(), TU)))
-      return true;
-  return false;
-}
-
 bool CursorVisitor::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *PD) {
   if (ObjCIvarDecl *Ivar = PD->getPropertyIvarDecl())
     return Visit(MakeCursorMemberRef(Ivar, PD->getPropertyIvarDeclLoc(), TU));
@@ -1150,8 +1133,8 @@
     // FIXME: Per-identifier location info?
     return false;
   }
-  
-  return false;
+
+  llvm_unreachable("Invalid DeclarationName::Kind!");
 }
 
 bool CursorVisitor::VisitNestedNameSpecifier(NestedNameSpecifier *NNS, 
@@ -1289,8 +1272,8 @@
                   Name.getAsSubstTemplateTemplateParmPack()->getParameterPack(),
                                        Loc, TU));
   }
-                 
-  return false;
+
+  llvm_unreachable("Invalid TemplateName::Kind!");
 }
 
 bool CursorVisitor::VisitTemplateArgumentLoc(const TemplateArgumentLoc &TAL) {
@@ -1323,8 +1306,8 @@
     return VisitTemplateName(TAL.getArgument().getAsTemplateOrTemplatePattern(), 
                              TAL.getTemplateNameLoc());
   }
-  
-  return false;
+
+  llvm_unreachable("Invalid TemplateArgument::Kind!");
 }
 
 bool CursorVisitor::VisitLinkageSpecDecl(LinkageSpecDecl *D) {
@@ -3401,7 +3384,6 @@
   }
 
   llvm_unreachable("Unhandled CXCursorKind");
-  return createCXString((const char*) 0);
 }
 
 struct GetCursorData {
@@ -3890,11 +3872,6 @@
       return clang_getNullCursor();
     if (UsingDecl *Using = dyn_cast<UsingDecl>(D))
       return MakeCursorOverloadedDeclRef(Using, D->getLocation(), tu);
-    if (ObjCClassDecl *Classes = dyn_cast<ObjCClassDecl>(D))
-      return MakeCursorOverloadedDeclRef(Classes, D->getLocation(), tu);
-    if (ObjCForwardProtocolDecl *Protocols
-                                        = dyn_cast<ObjCForwardProtocolDecl>(D))
-      return MakeCursorOverloadedDeclRef(Protocols, D->getLocation(), tu);
     if (ObjCPropertyImplDecl *PropImpl =dyn_cast<ObjCPropertyImplDecl>(D))
       if (ObjCPropertyDecl *Property = PropImpl->getPropertyDecl())
         return MakeCXCursor(Property, tu);
@@ -3983,11 +3960,8 @@
     default:
       // We would prefer to enumerate all non-reference cursor kinds here.
       llvm_unreachable("Unhandled reference cursor kind");
-      break;
     }
   }
-
-  return clang_getNullCursor();
 }
 
 CXCursor clang_getCursorDefinition(CXCursor C) {
@@ -4136,23 +4110,24 @@
     return clang_getNullCursor();
 
   case Decl::ObjCProtocol:
-    if (!cast<ObjCProtocolDecl>(D)->isForwardDecl())
-      return C;
+    if (ObjCProtocolDecl *Def = cast<ObjCProtocolDecl>(D)->getDefinition())
+      return MakeCXCursor(Def, TU);
     return clang_getNullCursor();
 
-  case Decl::ObjCInterface:
+  case Decl::ObjCInterface: {
     // There are two notions of a "definition" for an Objective-C
     // class: the interface and its implementation. When we resolved a
     // reference to an Objective-C class, produce the @interface as
     // the definition; when we were provided with the interface,
     // produce the @implementation as the definition.
+    ObjCInterfaceDecl *IFace = cast<ObjCInterfaceDecl>(D);
     if (WasReference) {
-      if (ObjCInterfaceDecl *Def = cast<ObjCInterfaceDecl>(D)->getDefinition())
+      if (ObjCInterfaceDecl *Def = IFace->getDefinition())
         return MakeCXCursor(Def, TU);
-    } else if (ObjCImplementationDecl *Impl
-                              = cast<ObjCInterfaceDecl>(D)->getImplementation())
+    } else if (ObjCImplementationDecl *Impl = IFace->getImplementation())
       return MakeCXCursor(Impl, TU);
     return clang_getNullCursor();
+  }
 
   case Decl::ObjCProperty:
     // FIXME: We don't really know where to find the
@@ -4167,14 +4142,6 @@
 
     return clang_getNullCursor();
 
-  case Decl::ObjCForwardProtocol:
-    return MakeCursorOverloadedDeclRef(cast<ObjCForwardProtocolDecl>(D), 
-                                       D->getLocation(), TU);
-
-  case Decl::ObjCClass:
-    return MakeCursorOverloadedDeclRef(cast<ObjCClassDecl>(D), D->getLocation(),
-                                       TU);
-
   case Decl::Friend:
     if (NamedDecl *Friend = cast<FriendDecl>(D)->getFriendDecl())
       return clang_getCursorDefinition(MakeCXCursor(Friend, TU));
@@ -4230,10 +4197,6 @@
   Decl *D = Storage.get<Decl*>();
   if (UsingDecl *Using = dyn_cast<UsingDecl>(D))
     return Using->shadow_size();
-  if (isa<ObjCClassDecl>(D))
-    return 1;
-  if (ObjCForwardProtocolDecl *Protocols =dyn_cast<ObjCForwardProtocolDecl>(D))
-    return Protocols->protocol_size();
   
   return 0;
 }
@@ -4261,10 +4224,6 @@
     std::advance(Pos, index);
     return MakeCXCursor(cast<UsingShadowDecl>(*Pos)->getTargetDecl(), TU);
   }
-  if (ObjCClassDecl *Classes = dyn_cast<ObjCClassDecl>(D))
-    return MakeCXCursor(Classes->getForwardInterfaceDecl(), TU);
-  if (ObjCForwardProtocolDecl *Protocols = dyn_cast<ObjCForwardProtocolDecl>(D))
-    return MakeCXCursor(Protocols->protocol_begin()[index], TU);
   
   return clang_getNullCursor();
 }
@@ -5191,9 +5150,7 @@
     case Decl::ObjCAtDefsField:
     case Decl::ObjCCategory:
     case Decl::ObjCCategoryImpl:
-    case Decl::ObjCClass:
     case Decl::ObjCCompatibleAlias:
-    case Decl::ObjCForwardProtocol:
     case Decl::ObjCImplementation:
     case Decl::ObjCInterface:
     case Decl::ObjCIvar:

Modified: cfe/branches/tooling/tools/libclang/CIndexCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CIndexCXX.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CIndexCXX.cpp (original)
+++ cfe/branches/tooling/tools/libclang/CIndexCXX.cpp Fri Jan 20 10:14:22 2012
@@ -46,9 +46,8 @@
     case AS_private: return CX_CXXPrivate;
     case AS_none: return CX_CXXInvalidAccessSpecifier;
   }
-  
-  // FIXME: Clang currently thinks this is reachable.
-  return CX_CXXInvalidAccessSpecifier;
+
+  llvm_unreachable("Invalid AccessSpecifier!");
 }
 
 enum CXCursorKind clang_getTemplateCursorKind(CXCursor C) {

Modified: cfe/branches/tooling/tools/libclang/CIndexCodeCompletion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CIndexCodeCompletion.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CIndexCodeCompletion.cpp (original)
+++ cfe/branches/tooling/tools/libclang/CIndexCodeCompletion.cpp Fri Jan 20 10:14:22 2012
@@ -104,8 +104,7 @@
     return CXCompletionChunk_VerticalSpace;
   }
 
-  // Should be unreachable, but let's be careful.
-  return CXCompletionChunk_Text;
+  llvm_unreachable("Invalid CompletionKind!");
 }
 
 CXString clang_getCompletionChunkText(CXCompletionString completion_string,
@@ -182,8 +181,7 @@
     return (*CCStr)[chunk_number].Optional;
   }
 
-  // Should be unreachable, but let's be careful.
-  return 0;
+  llvm_unreachable("Invalid CompletionKind!");
 }
 
 unsigned clang_getNumCompletionChunks(CXCompletionString completion_string) {

Modified: cfe/branches/tooling/tools/libclang/CIndexUSRs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CIndexUSRs.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CIndexUSRs.cpp (original)
+++ cfe/branches/tooling/tools/libclang/CIndexUSRs.cpp Fri Jan 20 10:14:22 2012
@@ -75,9 +75,7 @@
   void VisitNamespaceAliasDecl(NamespaceAliasDecl *D);
   void VisitFunctionTemplateDecl(FunctionTemplateDecl *D);
   void VisitClassTemplateDecl(ClassTemplateDecl *D);
-  void VisitObjCClassDecl(ObjCClassDecl *CD);
   void VisitObjCContainerDecl(ObjCContainerDecl *CD);
-  void VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *P);
   void VisitObjCMethodDecl(ObjCMethodDecl *MD);
   void VisitObjCPropertyDecl(ObjCPropertyDecl *D);
   void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D);
@@ -310,18 +308,6 @@
   N.printName(Out);
 }
 
-void USRGenerator::VisitObjCClassDecl(ObjCClassDecl *D) {
-  // FIXME: @class declarations can refer to multiple classes.  We need
-  //  to be able to traverse these.
-  IgnoreResults = true;
-}
-
-void USRGenerator::VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D) {
-  // FIXME: @protocol declarations can refer to multiple protocols.  We need
-  //  to be able to traverse these.
-  IgnoreResults = true;
-}
-
 void USRGenerator::VisitObjCContainerDecl(ObjCContainerDecl *D) {
   switch (D->getKind()) {
     default:
@@ -409,7 +395,7 @@
       case TTK_Struct: Out << "@ST"; break;
       case TTK_Class:  Out << "@CT"; break;
       case TTK_Union:  Out << "@UT"; break;
-      case TTK_Enum: llvm_unreachable("enum template"); break;
+      case TTK_Enum: llvm_unreachable("enum template");
       }
       VisitTemplateParameterList(ClassTmpl->getTemplateParameters());
     } else if (ClassTemplatePartialSpecializationDecl *PartialSpec
@@ -420,7 +406,7 @@
       case TTK_Struct: Out << "@SP"; break;
       case TTK_Class:  Out << "@CP"; break;
       case TTK_Union:  Out << "@UP"; break;
-      case TTK_Enum: llvm_unreachable("enum partial specialization"); break;
+      case TTK_Enum: llvm_unreachable("enum partial specialization");
       }      
       VisitTemplateParameterList(PartialSpec->getTemplateParameters());
     }

Modified: cfe/branches/tooling/tools/libclang/CIndexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CIndexer.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CIndexer.cpp (original)
+++ cfe/branches/tooling/tools/libclang/CIndexer.cpp Fri Jan 20 10:14:22 2012
@@ -21,7 +21,7 @@
 #include "clang/Basic/Version.h"
 #include "clang/Sema/CodeCompleteConsumer.h"
 #include "llvm/ADT/StringExtras.h"
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/raw_ostream.h"

Modified: cfe/branches/tooling/tools/libclang/CXCursor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CXCursor.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CXCursor.cpp (original)
+++ cfe/branches/tooling/tools/libclang/CXCursor.cpp Fri Jan 20 10:14:22 2012
@@ -1021,30 +1021,28 @@
     Decl *decl = getCursorDecl(cursor);
     if (NamedDecl *namedDecl = dyn_cast_or_null<NamedDecl>(decl)) {
       ASTUnit *unit = getCursorASTUnit(cursor);
-      if (unit->hasSema()) {
-        Sema &S = unit->getSema();
-        CodeCompletionAllocator *Allocator 
-          = unit->getCursorCompletionAllocator().getPtr();
-        CodeCompletionResult Result(namedDecl);
-        CodeCompletionString *String 
-          = Result.CreateCodeCompletionString(S, *Allocator);
-        return String;
-      }
+      CodeCompletionAllocator *Allocator
+        = unit->getCursorCompletionAllocator().getPtr();
+      CodeCompletionResult Result(namedDecl);
+      CodeCompletionString *String
+        = Result.CreateCodeCompletionString(unit->getASTContext(),
+                                            unit->getPreprocessor(),
+                                            *Allocator);
+      return String;
     }
   }
   else if (kind == CXCursor_MacroDefinition) {
     MacroDefinition *definition = getCursorMacroDefinition(cursor);
     const IdentifierInfo *MacroInfo = definition->getName();
     ASTUnit *unit = getCursorASTUnit(cursor);
-    if (unit->hasSema()) {
-      Sema &S = unit->getSema();
-      CodeCompletionAllocator *Allocator
-        = unit->getCursorCompletionAllocator().getPtr();
-      CodeCompletionResult Result(const_cast<IdentifierInfo *>(MacroInfo));
-      CodeCompletionString *String 
-        = Result.CreateCodeCompletionString(S, *Allocator);
-      return String;
-    }
+    CodeCompletionAllocator *Allocator
+      = unit->getCursorCompletionAllocator().getPtr();
+    CodeCompletionResult Result(const_cast<IdentifierInfo *>(MacroInfo));
+    CodeCompletionString *String
+      = Result.CreateCodeCompletionString(unit->getASTContext(),
+                                          unit->getPreprocessor(),
+                                          *Allocator);
+    return String;
   }
   return NULL;
 }

Modified: cfe/branches/tooling/tools/libclang/CXLoadedDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CXLoadedDiagnostic.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CXLoadedDiagnostic.cpp (original)
+++ cfe/branches/tooling/tools/libclang/CXLoadedDiagnostic.cpp Fri Jan 20 10:14:22 2012
@@ -84,7 +84,6 @@
   }
   
   llvm_unreachable("Invalid diagnostic level");
-  return CXDiagnostic_Ignored;
 }
 
 static CXSourceLocation makeLocation(const CXLoadedDiagnostic::Location *DLoc) {
@@ -297,7 +296,6 @@
         return 0;
       case Read_Record:
         llvm_unreachable("Top-level does not have records");
-        return 0;
       case Read_BlockEnd:
         continue;
       case Read_BlockBegin:
@@ -555,7 +553,6 @@
     switch (Res) {
       case Read_EndOfStream:
         llvm_unreachable("EndOfStream handled in readToNextRecordOrBlock");
-        return Failure;
       case Read_Failure:
         return Failure;
       case Read_BlockBegin: {

Modified: cfe/branches/tooling/tools/libclang/CXStoredDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CXStoredDiagnostic.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CXStoredDiagnostic.cpp (original)
+++ cfe/branches/tooling/tools/libclang/CXStoredDiagnostic.cpp Fri Jan 20 10:14:22 2012
@@ -38,7 +38,6 @@
   }
   
   llvm_unreachable("Invalid diagnostic level");
-  return CXDiagnostic_Ignored;
 }
 
 CXSourceLocation CXStoredDiagnostic::getLocation() const {

Modified: cfe/branches/tooling/tools/libclang/CXType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CXType.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CXType.cpp (original)
+++ cfe/branches/tooling/tools/libclang/CXType.cpp Fri Jan 20 10:14:22 2012
@@ -443,8 +443,6 @@
       TCALLINGCONV(X86Pascal);
       TCALLINGCONV(AAPCS);
       TCALLINGCONV(AAPCS_VFP);
-    default:
-      return CXCallingConv_Unexposed;
     }
 #undef TCALLINGCONV
   }

Modified: cfe/branches/tooling/tools/libclang/CursorVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CursorVisitor.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CursorVisitor.h (original)
+++ cfe/branches/tooling/tools/libclang/CursorVisitor.h Fri Jan 20 10:14:22 2012
@@ -215,8 +215,6 @@
   bool VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D);
   bool VisitObjCImplementationDecl(ObjCImplementationDecl *D);
   // FIXME: ObjCCompatibleAliasDecl requires aliased-class locations.
-  bool VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D);
-  bool VisitObjCClassDecl(ObjCClassDecl *D);
   bool VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *PD);
   bool VisitLinkageSpecDecl(LinkageSpecDecl *D);
   bool VisitNamespaceDecl(NamespaceDecl *D);

Modified: cfe/branches/tooling/tools/libclang/IndexBody.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/IndexBody.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/IndexBody.cpp (original)
+++ cfe/branches/tooling/tools/libclang/IndexBody.cpp Fri Jan 20 10:14:22 2012
@@ -10,7 +10,6 @@
 #include "IndexingContext.h"
 
 #include "clang/AST/RecursiveASTVisitor.h"
-#include "clang/Analysis/Support/SaveAndRestore.h"
 
 using namespace clang;
 using namespace cxindex;
@@ -21,14 +20,12 @@
   IndexingContext &IndexCtx;
   const NamedDecl *Parent;
   const DeclContext *ParentDC;
-  bool InPseudoObject;
 
   typedef RecursiveASTVisitor<BodyIndexer> base;
 public:
   BodyIndexer(IndexingContext &indexCtx,
               const NamedDecl *Parent, const DeclContext *DC)
-    : IndexCtx(indexCtx), Parent(Parent), ParentDC(DC),
-      InPseudoObject(false) { }
+    : IndexCtx(indexCtx), Parent(Parent), ParentDC(DC) { }
   
   bool shouldWalkTypesOfTypeLocs() const { return false; }
 
@@ -62,8 +59,8 @@
     if (ObjCMethodDecl *MD = E->getMethodDecl())
       IndexCtx.handleReference(MD, E->getSelectorStartLoc(),
                                Parent, ParentDC, E,
-                               InPseudoObject ? CXIdxEntityRef_Implicit
-                                              : CXIdxEntityRef_Direct);
+                               E->isImplicit() ? CXIdxEntityRef_Implicit
+                                               : CXIdxEntityRef_Direct);
     return true;
   }
 
@@ -82,16 +79,17 @@
     return true;
   }
 
-  bool TraversePseudoObjectExpr(PseudoObjectExpr *E) {
-    SaveAndRestore<bool> InPseudo(InPseudoObject, true);
-    return base::TraversePseudoObjectExpr(E);
-  }
-
   bool VisitCXXConstructExpr(CXXConstructExpr *E) {
     IndexCtx.handleReference(E->getConstructor(), E->getLocation(),
                              Parent, ParentDC, E);
     return true;
   }
+
+  bool VisitDeclStmt(DeclStmt *S) {
+    if (IndexCtx.indexFunctionLocalSymbols())
+      IndexCtx.indexDeclGroupRef(S->getDeclGroup());
+    return true;
+  }
 };
 
 } // anonymous namespace

Modified: cfe/branches/tooling/tools/libclang/IndexDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/IndexDecl.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/IndexDecl.cpp (original)
+++ cfe/branches/tooling/tools/libclang/IndexDecl.cpp Fri Jan 20 10:14:22 2012
@@ -25,8 +25,20 @@
 
   void handleDeclarator(DeclaratorDecl *D, const NamedDecl *Parent = 0) {
     if (!Parent) Parent = D;
-    IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), Parent);
-    IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), Parent);
+
+    if (!IndexCtx.indexFunctionLocalSymbols()) {
+      IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), Parent);
+      IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), Parent);
+    } else {
+      if (ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) {
+        IndexCtx.handleVar(Parm);
+      } else if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
+        for (FunctionDecl::param_iterator
+               PI = FD->param_begin(), PE = FD->param_end(); PI != PE; ++PI) {
+          IndexCtx.handleVar(*PI);
+        }
+      }
+    }
   }
 
   bool VisitFunctionDecl(FunctionDecl *D) {
@@ -77,45 +89,23 @@
     return true;
   }
 
-  bool VisitObjCClassDecl(ObjCClassDecl *D) {
-    IndexCtx.handleObjCClass(D);
-    return true;
-  }
-
-  bool VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D) {
-    ObjCForwardProtocolDecl::protocol_loc_iterator LI = D->protocol_loc_begin();
-    for (ObjCForwardProtocolDecl::protocol_iterator
-           I = D->protocol_begin(), E = D->protocol_end(); I != E; ++I, ++LI) {
-      SourceLocation Loc = *LI;
-      ObjCProtocolDecl *PD = *I;
-
-      bool isRedeclaration = PD->getLocation() != Loc;
-      IndexCtx.handleObjCForwardProtocol(PD, Loc, isRedeclaration);
-    }
-    return true;
-  }
-
   bool VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) {
-    // Forward decls are handled at VisitObjCClassDecl.
-    if (!D->isThisDeclarationADefinition())
-      return true;
-
     IndexCtx.handleObjCInterface(D);
 
-    IndexCtx.indexTUDeclsInObjCContainer();
-    IndexCtx.indexDeclContext(D);
+    if (D->isThisDeclarationADefinition()) {
+      IndexCtx.indexTUDeclsInObjCContainer();
+      IndexCtx.indexDeclContext(D);
+    }
     return true;
   }
 
   bool VisitObjCProtocolDecl(ObjCProtocolDecl *D) {
-    // Forward decls are handled at VisitObjCForwardProtocolDecl.
-    if (D->isForwardDecl())
-      return true;
-
     IndexCtx.handleObjCProtocol(D);
 
-    IndexCtx.indexTUDeclsInObjCContainer();
-    IndexCtx.indexDeclContext(D);
+    if (D->isThisDeclarationADefinition()) {
+      IndexCtx.indexTUDeclsInObjCContainer();
+      IndexCtx.indexDeclContext(D);
+    }
     return true;
   }
 

Modified: cfe/branches/tooling/tools/libclang/Indexing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/Indexing.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/Indexing.cpp (original)
+++ cfe/branches/tooling/tools/libclang/Indexing.cpp Fri Jan 20 10:14:22 2012
@@ -176,6 +176,7 @@
     IndexCtx.setASTContext(CI.getASTContext());
     Preprocessor &PP = CI.getPreprocessor();
     PP.addPPCallbacks(new IndexPPCallbacks(PP, IndexCtx));
+    IndexCtx.setPreprocessor(PP);
     return new IndexingConsumer(IndexCtx);
   }
 

Modified: cfe/branches/tooling/tools/libclang/IndexingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/IndexingContext.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/IndexingContext.cpp (original)
+++ cfe/branches/tooling/tools/libclang/IndexingContext.cpp Fri Jan 20 10:14:22 2012
@@ -49,7 +49,7 @@
 
 IBOutletCollectionInfo::IBOutletCollectionInfo(
                                           const IBOutletCollectionInfo &other)
-  : AttrInfo(CXIdxAttr_IBOutletCollection, other.cursor, other.loc, A) {
+  : AttrInfo(CXIdxAttr_IBOutletCollection, other.cursor, other.loc, other.A) {
 
   IBCollInfo.attrInfo = this;
   IBCollInfo.classCursor = other.IBCollInfo.classCursor;
@@ -208,6 +208,10 @@
   static_cast<ASTUnit*>(CXTU->TUData)->setASTContext(&ctx);
 }
 
+void IndexingContext::setPreprocessor(Preprocessor &PP) {
+  static_cast<ASTUnit*>(CXTU->TUData)->setPreprocessor(&PP);
+}
+
 bool IndexingContext::shouldAbort() {
   if (!CB.abortQuery)
     return false;
@@ -261,7 +265,8 @@
 
   ScratchAlloc SA(*this);
   getEntityInfo(D, DInfo.EntInfo, SA);
-  if (!DInfo.EntInfo.USR || Loc.isInvalid())
+  if ((!indexFunctionLocalSymbols() && !DInfo.EntInfo.USR)
+      || Loc.isInvalid())
     return false;
 
   if (suppressRefs())
@@ -335,24 +340,22 @@
   return handleDecl(D, D->getLocation(), getCursor(D), DInfo);
 }
 
-bool IndexingContext::handleObjCClass(const ObjCClassDecl *D) {
-  ObjCInterfaceDecl *IFaceD = D->getForwardInterfaceDecl();
-  SourceLocation Loc = D->getNameLoc();
-  bool isRedeclaration = IFaceD->getLocation() != Loc;
- 
+bool IndexingContext::handleObjCInterface(const ObjCInterfaceDecl *D) {
   // For @class forward declarations, suppress them the same way as references.
-  if (suppressRefs()) {
-    if (markEntityOccurrenceInFile(IFaceD, Loc))
+  if (!D->isThisDeclarationADefinition()) {
+    if (suppressRefs() && markEntityOccurrenceInFile(D, D->getLocation()))
       return false; // already occurred.
-  }
 
-  ObjCContainerDeclInfo ContDInfo(/*isForwardRef=*/true, isRedeclaration,
-                                  /*isImplementation=*/false);
-  return handleObjCContainer(IFaceD, Loc,
-                          MakeCursorObjCClassRef(IFaceD, Loc, CXTU), ContDInfo);
-}
+    // FIXME: This seems like the wrong definition for redeclaration.
+    bool isRedeclaration = D->hasDefinition() || D->getPreviousDecl();
+    ObjCContainerDeclInfo ContDInfo(/*isForwardRef=*/true, isRedeclaration,
+                                    /*isImplementation=*/false);
+    return handleObjCContainer(D, D->getLocation(),
+                               MakeCursorObjCClassRef(D, D->getLocation(),
+                                                      CXTU), 
+                               ContDInfo);
+  }
 
-bool IndexingContext::handleObjCInterface(const ObjCInterfaceDecl *D) {
   ScratchAlloc SA(*this);
 
   CXIdxBaseClassInfo BaseClass;
@@ -370,8 +373,9 @@
   }
   
   ObjCProtocolList EmptyProtoList;
-  ObjCProtocolListInfo ProtInfo(D->hasDefinition()? D->getReferencedProtocols()
-                                                  : EmptyProtoList, 
+  ObjCProtocolListInfo ProtInfo(D->isThisDeclarationADefinition() 
+                                  ? D->getReferencedProtocols()
+                                  : EmptyProtoList, 
                                 *this, SA);
   
   ObjCInterfaceDeclInfo InterInfo(D);
@@ -391,19 +395,28 @@
   return handleObjCContainer(D, D->getLocation(), getCursor(D), ContDInfo);
 }
 
-bool IndexingContext::handleObjCForwardProtocol(const ObjCProtocolDecl *D,
-                                                SourceLocation Loc,
-                                                bool isRedeclaration) {
-  ObjCContainerDeclInfo ContDInfo(/*isForwardRef=*/true,
-                                  isRedeclaration,
-                                  /*isImplementation=*/false);
-  return handleObjCContainer(D, Loc, MakeCursorObjCProtocolRef(D, Loc, CXTU),
-                             ContDInfo);
-}
-
 bool IndexingContext::handleObjCProtocol(const ObjCProtocolDecl *D) {
+  if (!D->isThisDeclarationADefinition()) {
+    if (suppressRefs() && markEntityOccurrenceInFile(D, D->getLocation()))
+      return false; // already occurred.
+    
+    // FIXME: This seems like the wrong definition for redeclaration.
+    bool isRedeclaration = D->hasDefinition() || D->getPreviousDecl();
+    ObjCContainerDeclInfo ContDInfo(/*isForwardRef=*/true,
+                                    isRedeclaration,
+                                    /*isImplementation=*/false);
+    return handleObjCContainer(D, D->getLocation(), 
+                               MakeCursorObjCProtocolRef(D, D->getLocation(),
+                                                         CXTU),
+                               ContDInfo);    
+  }
+  
   ScratchAlloc SA(*this);
-  ObjCProtocolListInfo ProtListInfo(D->getReferencedProtocols(), *this, SA);
+  ObjCProtocolList EmptyProtoList;
+  ObjCProtocolListInfo ProtListInfo(D->isThisDeclarationADefinition()
+                                      ? D->getReferencedProtocols()
+                                      : EmptyProtoList,
+                                    *this, SA);
   
   ObjCProtocolDeclInfo ProtInfo(D);
   ProtInfo.ObjCProtoRefListInfo = ProtListInfo.getListInfo();
@@ -543,7 +556,7 @@
     return false;
   if (Loc.isInvalid())
     return false;
-  if (D->getParentFunctionOrMethod())
+  if (!indexFunctionLocalSymbols() && D->getParentFunctionOrMethod())
     return false;
   if (isNotFromSourceFile(D->getLocation()))
     return false;
@@ -821,6 +834,9 @@
     case Decl::Function:
       EntityInfo.kind = CXIdxEntity_Function;
       break;
+    case Decl::ParmVar:
+      EntityInfo.kind = CXIdxEntity_Variable;
+      break;
     case Decl::Var:
       EntityInfo.kind = CXIdxEntity_Variable;
       if (isa<CXXRecordDecl>(D->getDeclContext())) {

Modified: cfe/branches/tooling/tools/libclang/IndexingContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/IndexingContext.h?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/IndexingContext.h (original)
+++ cfe/branches/tooling/tools/libclang/IndexingContext.h Fri Jan 20 10:14:22 2012
@@ -17,7 +17,6 @@
 namespace clang {
   class FileEntry;
   class ObjCPropertyDecl;
-  class ObjCClassDecl;
   class ClassTemplateDecl;
   class FunctionTemplateDecl;
   class TypeAliasTemplateDecl;
@@ -128,7 +127,7 @@
   ObjCInterfaceDeclInfo(const ObjCInterfaceDecl *D)
     : ObjCContainerDeclInfo(Info_ObjCInterface,
                             /*isForwardRef=*/false,
-                          /*isRedeclaration=*/D->getPreviousDeclaration() != 0,
+                          /*isRedeclaration=*/D->getPreviousDecl() != 0,
                             /*isImplementation=*/false) { }
 
   static bool classof(const DeclInfo *D) {
@@ -143,7 +142,7 @@
   ObjCProtocolDeclInfo(const ObjCProtocolDecl *D)
     : ObjCContainerDeclInfo(Info_ObjCProtocol,
                             /*isForwardRef=*/false,
-                            /*isRedeclaration=*/D->isInitiallyForwardDecl(),
+                            /*isRedeclaration=*/D->getPreviousDecl(),
                             /*isImplementation=*/false) { }
 
   static bool classof(const DeclInfo *D) {
@@ -320,11 +319,16 @@
   ASTContext &getASTContext() const { return *Ctx; }
 
   void setASTContext(ASTContext &ctx);
+  void setPreprocessor(Preprocessor &PP);
 
   bool suppressRefs() const {
     return IndexOptions & CXIndexOpt_SuppressRedundantRefs;
   }
 
+  bool indexFunctionLocalSymbols() const {
+    return IndexOptions & CXIndexOpt_IndexFunctionLocalSymbols;
+  }
+
   bool shouldAbort();
 
   bool hasDiagnosticCallback() const { return CB.diagnostic; }
@@ -370,14 +374,9 @@
   
   bool handleTypedefName(const TypedefNameDecl *D);
 
-  bool handleObjCClass(const ObjCClassDecl *D);
   bool handleObjCInterface(const ObjCInterfaceDecl *D);
   bool handleObjCImplementation(const ObjCImplementationDecl *D);
 
-  bool handleObjCForwardProtocol(const ObjCProtocolDecl *D,
-                                 SourceLocation Loc,
-                                 bool isRedeclaration);
-
   bool handleObjCProtocol(const ObjCProtocolDecl *D);
 
   bool handleObjCCategory(const ObjCCategoryDecl *D);

Modified: cfe/branches/tooling/tools/scan-build/ccc-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/scan-build/ccc-analyzer?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/scan-build/ccc-analyzer (original)
+++ cfe/branches/tooling/tools/scan-build/ccc-analyzer Fri Jan 20 10:14:22 2012
@@ -27,17 +27,27 @@
 
 my $Compiler;
 my $Clang;
+my $DefaultCCompiler;
+my $DefaultCXXCompiler;
+
+if (`uname -a` =~ m/Darwin/) { 
+	$DefaultCCompiler = 'clang';
+	$DefaultCXXCompiler = 'clang++'; 
+} else {
+    $DefaultCCompiler = 'gcc';
+    $DefaultCXXCompiler = 'g++'; 	
+}
 
 if ($FindBin::Script =~ /c\+\+-analyzer/) {
   $Compiler = $ENV{'CCC_CXX'};
-  if (!defined $Compiler) { $Compiler = "g++"; }
+  if (!defined $Compiler) { $Compiler = $DefaultCXXCompiler; }
   
   $Clang = $ENV{'CLANG_CXX'};
   if (!defined $Clang) { $Clang = 'clang++'; }
 }
 else {
   $Compiler = $ENV{'CCC_CC'};
-  if (!defined $Compiler) { $Compiler = "gcc"; }
+  if (!defined $Compiler) { $Compiler = $DefaultCCompiler; }
 
   $Clang = $ENV{'CLANG'};
   if (!defined $Clang) { $Clang = 'clang'; }
@@ -367,7 +377,8 @@
   '-multiply_defined' => 1,
   '-sectorder' => 3,
   '--param' => 1,
-  '-u' => 1
+  '-u' => 1,
+  '--serialize-diagnostics' => 1
 );
 
 my %LangMap = (

Modified: cfe/branches/tooling/tools/scan-build/scan-build
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/scan-build/scan-build?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/scan-build/scan-build (original)
+++ cfe/branches/tooling/tools/scan-build/scan-build Fri Jan 20 10:14:22 2012
@@ -967,11 +967,11 @@
                   exit status of $Prog to be 1 if it found potential bugs
                   and 0 otherwise.
 
- --use-cc [compiler path]   - By default, $Prog uses 'gcc' to compile and link
+ --use-cc [compiler path]   - $Prog attempts to guess the default compiler for
  --use-cc=[compiler path]     your C and Objective-C code. Use this option
                               to specify an alternate compiler.
 
- --use-c++ [compiler path]  - By default, $Prog uses 'g++' to compile and link
+ --use-c++ [compiler path]  - $Prog attempts to guess the default compiler for
  --use-c++=[compiler path]    your C++ and Objective-C++ code. Use this option
                               to specify an alternate compiler.
 

Modified: cfe/branches/tooling/tools/scan-build/set-xcode-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/scan-build/set-xcode-analyzer?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/scan-build/set-xcode-analyzer (original)
+++ cfe/branches/tooling/tools/scan-build/set-xcode-analyzer Fri Jan 20 10:14:22 2012
@@ -1,4 +1,8 @@
-#!/usr/bin/env python
+#!/usr/bin/python
+
+# [PR 11661] Note that we hardwire to /usr/bin/python because we
+# want to the use the system version of Python on Mac OS X.
+# This one has the scripting bridge enabled.
 
 import os
 import sys

Modified: cfe/branches/tooling/unittests/Basic/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/unittests/Basic/Makefile?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/unittests/Basic/Makefile (original)
+++ cfe/branches/tooling/unittests/Basic/Makefile Fri Jan 20 10:14:22 2012
@@ -10,6 +10,6 @@
 CLANG_LEVEL = ../..
 TESTNAME = Basic
 LINK_COMPONENTS := support mc
-USEDLIBS = clangBasic.a
+USEDLIBS = clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/unittests/Makefile

Modified: cfe/branches/tooling/unittests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/unittests/CMakeLists.txt?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/unittests/CMakeLists.txt (original)
+++ cfe/branches/tooling/unittests/CMakeLists.txt Fri Jan 20 10:14:22 2012
@@ -57,7 +57,13 @@
 
 add_clang_unittest(Basic
   Basic/FileManagerTest.cpp
-  USED_LIBS gtest gtest_main clangBasic
+  Basic/SourceManagerTest.cpp
+  USED_LIBS gtest gtest_main clangLex
+ )
+
+add_clang_unittest(Lex
+  Lex/LexerTest.cpp
+  USED_LIBS gtest gtest_main clangLex
  )
 
 add_clang_unittest(Frontend

Modified: cfe/branches/tooling/unittests/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/unittests/Makefile?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/unittests/Makefile (original)
+++ cfe/branches/tooling/unittests/Makefile Fri Jan 20 10:14:22 2012
@@ -14,7 +14,7 @@
 
 IS_UNITTEST_LEVEL := 1
 CLANG_LEVEL := ..
-PARALLEL_DIRS = ASTMatchers Basic Frontend Tooling
+PARALLEL_DIRS = ASTMatchers Basic Frontend Lex Tooling
 
 endif  # CLANG_LEVEL
 

Modified: cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp (original)
+++ cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp Fri Jan 20 10:14:22 2012
@@ -33,8 +33,6 @@
     assert(*i && "Got a null element in a ListInit");
     if (StringInit *S = dynamic_cast<StringInit *>(*i))
       Strings.push_back(S->getValue());
-    else if (CodeInit *C = dynamic_cast<CodeInit *>(*i))
-      Strings.push_back(C->getValue());
     else
       assert(false && "Got a non-string, non-code element in a ListInit");
   }
@@ -625,7 +623,7 @@
       OS << "\n\n";
     }
 
-    OS << R.getValueAsCode("AdditionalMembers");
+    OS << R.getValueAsString("AdditionalMembers");
     OS << "\n\n";
 
     OS << "  static bool classof(const Attr *A) { return A->getKind() == "

Modified: cfe/branches/tooling/utils/TableGen/ClangDiagnosticsEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/TableGen/ClangDiagnosticsEmitter.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/utils/TableGen/ClangDiagnosticsEmitter.cpp (original)
+++ cfe/branches/tooling/utils/TableGen/ClangDiagnosticsEmitter.cpp Fri Jan 20 10:14:22 2012
@@ -18,7 +18,6 @@
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/VectorExtras.h"
 #include <map>
 #include <algorithm>
 #include <functional>

Modified: cfe/branches/tooling/utils/TableGen/NeonEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/TableGen/NeonEmitter.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/utils/TableGen/NeonEmitter.cpp (original)
+++ cfe/branches/tooling/utils/TableGen/NeonEmitter.cpp Fri Jan 20 10:14:22 2012
@@ -28,6 +28,7 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/ErrorHandling.h"
 #include <string>
 
 using namespace llvm;
@@ -56,7 +57,6 @@
       default:
         throw TGError(r->getLoc(),
                       "Unexpected letter: " + std::string(data + len, 1));
-        break;
     }
     TV.push_back(StringRef(data, len + 1));
     data += len + 1;
@@ -78,7 +78,6 @@
       return 'f';
     default: throw "unhandled type in widen!";
   }
-  return '\0';
 }
 
 /// Narrow - Convert a type code into the next smaller type.  short -> char,
@@ -95,7 +94,6 @@
       return 'h';
     default: throw "unhandled type in narrow!";
   }
-  return '\0';
 }
 
 /// For a particular StringRef, return the base type code, and whether it has
@@ -266,7 +264,6 @@
       break;
     default:
       throw "unhandled type!";
-      break;
   }
 
   if (mod == '2')
@@ -449,7 +446,6 @@
     break;
   default:
     throw "unhandled type!";
-    break;
   }
   if (ck == ClassB)
     s += "_v";
@@ -588,7 +584,6 @@
   case 'f': nElts = 2; break;
   default:
     throw "unhandled type!";
-    break;
   }
   if (quad) nElts <<= 1;
   return nElts;
@@ -820,7 +815,6 @@
   }
   default:
     throw "unknown OpKind!";
-    break;
   }
   return s;
 }
@@ -866,7 +860,6 @@
       break;
     default:
       throw "unhandled type!";
-      break;
   }
   NeonTypeFlags Flags(ET, usgn, quad && proto[1] != 'g');
   return Flags.getFlags();
@@ -1239,10 +1232,7 @@
       return (1 << (int)quad) - 1;
     default:
       throw "unhandled type!";
-      break;
   }
-  assert(0 && "unreachable");
-  return 0;
 }
 
 /// runHeader - Emit a file with sections defining:
@@ -1356,6 +1346,17 @@
     if (PtrArgNum >= 0 && (Proto[0] >= '2' && Proto[0] <= '4'))
       PtrArgNum += 1;
 
+    // Omit type checking for the pointer arguments of vld1_lane, vld1_dup,
+    // and vst1_lane intrinsics.  Using a pointer to the vector element
+    // type with one of those operations causes codegen to select an aligned
+    // load/store instruction.  If you want an unaligned operation,
+    // the pointer argument needs to have less alignment than element type,
+    // so just accept any pointer type.
+    if (name == "vld1_lane" || name == "vld1_dup" || name == "vst1_lane") {
+      PtrArgNum = -1;
+      HasConstPtr = false;
+    }
+
     if (mask) {
       OS << "case ARM::BI__builtin_neon_"
          << MangleName(name, TypeVec[si], ClassB)

Modified: cfe/branches/tooling/utils/TableGen/TableGen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/TableGen/TableGen.cpp?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/utils/TableGen/TableGen.cpp (original)
+++ cfe/branches/tooling/utils/TableGen/TableGen.cpp Fri Jan 20 10:14:22 2012
@@ -96,7 +96,6 @@
   ClangComponent("clang-component",
                  cl::desc("Only use warnings from specified component"),
                  cl::value_desc("component"), cl::Hidden);
-}
 
 class ClangTableGenAction : public TableGenAction {
 public:
@@ -157,14 +156,12 @@
     case GenArmNeonTest:
       NeonEmitter(Records).runTests(OS);
       break;
-    default:
-      assert(1 && "Invalid Action");
-      return true;
     }
 
     return false;
   }
 };
+}
 
 int main(int argc, char **argv) {
   sys::PrintStackTraceOnErrorSignal();

Modified: cfe/branches/tooling/utils/analyzer/SATestBuild.py
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/analyzer/SATestBuild.py?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/utils/analyzer/SATestBuild.py (original)
+++ cfe/branches/tooling/utils/analyzer/SATestBuild.py Fri Jan 20 10:14:22 2012
@@ -78,6 +78,16 @@
 
 IsReferenceBuild = False
 
+# Make sure we flush the output after every print statement.
+class flushfile(object):
+    def __init__(self, f):
+        self.f = f
+    def write(self, x):
+        self.f.write(x)
+        self.f.flush()
+
+sys.stdout = flushfile(sys.stdout)
+
 def getProjectMapPath():
     ProjectMapPath = os.path.join(os.path.abspath(os.curdir), 
                                   ProjectMapFile)
@@ -298,8 +308,7 @@
     finally:
         SummaryLog.close()
     
-    print "Error: analysis failed. See ", \
-          os.path.join(SBOutputDir, FailuresSummaryFileName)
+    print "Error: analysis failed. See ", SummaryPath
     sys.exit(-1)       
 
 # Auxiliary object to discard stdout.
@@ -398,7 +407,6 @@
                 print "Error: Second entry in the ProjectMapFile should be 0 or 1."
                 raise Exception()              
             testProject(I[0], InIsReferenceBuild, int(I[1]))
-            sys.stdout.flush()
     except:
         print "Error occurred. Premature termination."
         raise                            

Modified: cfe/branches/tooling/www/OpenProjects.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/OpenProjects.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/OpenProjects.html (original)
+++ cfe/branches/tooling/www/OpenProjects.html Fri Jan 20 10:14:22 2012
@@ -2,10 +2,10 @@
           "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
-  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Clang - Get Involved</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
 </head>
 <body>
 

Modified: cfe/branches/tooling/www/UniversalDriver.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/UniversalDriver.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/UniversalDriver.html (original)
+++ cfe/branches/tooling/www/UniversalDriver.html Fri Jan 20 10:14:22 2012
@@ -2,10 +2,10 @@
           "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
-  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Clang - Universal Driver</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
 </head>
 <body>
 

Modified: cfe/branches/tooling/www/analyzer/annotations.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/analyzer/annotations.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/analyzer/annotations.html (original)
+++ cfe/branches/tooling/www/analyzer/annotations.html Fri Jan 20 10:14:22 2012
@@ -3,8 +3,8 @@
 <html>
 <head>
   <title>Source Annotations</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <script type="text/javascript" src="scripts/menu.js"></script>
 </head>
 <body>
@@ -106,7 +106,7 @@
 <p>Running <tt>scan-build</tt> over this source produces the following
 output:</p>
 
-<img src="images/example_attribute_nonnull.png">
+<img src="images/example_attribute_nonnull.png" alt="example attribute nonnull">
 
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <h2 id="macosx">Mac OS X API Annotations</h2>
@@ -192,7 +192,7 @@
 
 <p>Running <tt>scan-build</tt> on this source file produces the following output:</p>
 
-<img src="images/example_ns_returns_retained.png">
+<img src="images/example_ns_returns_retained.png" alt="example returns retained">
 
 <h4 id="attr_ns_returns_not_retained">Attribute 'ns_returns_not_retained'
 (Clang-specific)</h4>
@@ -242,7 +242,7 @@
   <li>Because Core Foundation is a C API, the analyzer cannot always tell that a
   pointer return value refers to a Core Foundation object. In contrast, it is
   trivial for the analyzer to recognize if a pointer refers to a Cocoa object
-  (given the Objective-C type system).</p>
+  (given the Objective-C type system).
 </ul>
 
 <p><b>Placing on C functions</b>: When placing the attribute
@@ -311,16 +311,16 @@
 
 <p>Running <tt>scan-build</tt> on this example produces the following output:</p>
 
-<img src="images/example_cf_returns_retained.png">
+<img src="images/example_cf_returns_retained.png" alt="example returns retained">
 
-</p>When the above code is compiled using Objective-C garbage collection (i.e.,
+<p>When the above code is compiled using Objective-C garbage collection (i.e.,
 code is compiled with the flag <tt>-fobjc-gc</tt> or <tt>-fobjc-gc-only</tt>),
 <tt>scan-build</tt> produces both the above error (with slightly different text
 to indicate the code uses garbage collection) as well as the following warning,
 which indicates a leak that occurs <em>only</em> when using garbage
 collection:</p>
 
-<img src="images/example_cf_returns_retained_gc.png">
+<img src="images/example_cf_returns_retained_gc.png" alt="example returns retained gc">
 
 <h4 id="attr_cf_returns_not_retained">Attribute 'cf_returns_not_retained'
 (Clang-specific)</h4>
@@ -590,6 +590,7 @@
 #else
 #define CLANG_ANALYZER_NORETURN
 #endif
+#endif
 
 void my_assert_rtn(const char *, const char *, int, const char *) <span class="code_highlight">CLANG_ANALYZER_NORETURN</span>;
 </pre>

Modified: cfe/branches/tooling/www/analyzer/available_checks.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/analyzer/available_checks.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/analyzer/available_checks.html (original)
+++ cfe/branches/tooling/www/analyzer/available_checks.html Fri Jan 20 10:14:22 2012
@@ -3,9 +3,12 @@
 <html>
 <head>
   <title>Available Checks</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <script type="text/javascript" src="scripts/menu.js"></script>
+  <style type="text/css">
+  tr:first-child { width:20%; }
+  </style>
 </head>
 <body>
 
@@ -24,103 +27,103 @@
 <th><h4>Description</h4></th>
 </tr>-->
 <tr>
-<td width="20%"><b>core.AdjustedReturnValue</b></td><td>Check to see if the return value of a function call is different than the caller expects (e.g., from calls through function pointers).</td>
+<td><b>core.AdjustedReturnValue</b></td><td>Check to see if the return value of a function call is different than the caller expects (e.g., from calls through function pointers).</td>
 </tr>
 <tr>
-<td width="20%"><b>core.AttributeNonNull</b></td><td>Check for null pointers passed as arguments to a function whose arguments are marked with the 'nonnull' attribute.</td>
+<td><b>core.AttributeNonNull</b></td><td>Check for null pointers passed as arguments to a function whose arguments are marked with the 'nonnull' attribute.</td>
 </tr>
 <tr>
-<td width="20%"><b>core.CallAndMessage</b></td><td>Check for logical errors for function calls and Objective-C message expressions (e.g., uninitialized arguments, null function pointers).</td>
+<td><b>core.CallAndMessage</b></td><td>Check for logical errors for function calls and Objective-C message expressions (e.g., uninitialized arguments, null function pointers).</td>
 </tr>
 <tr>
-<td width="20%"><b>core.DivideZero</b></td><td>Check for division by zero.</td>
+<td><b>core.DivideZero</b></td><td>Check for division by zero.</td>
 </tr>
 <tr>
-<td width="20%"><b>core.NullDereference</b></td><td>Check for dereferences of null pointers.</td>
+<td><b>core.NullDereference</b></td><td>Check for dereferences of null pointers.</td>
 </tr>
 <tr>
-<td width="20%"><b>core.StackAddressEscape</b></td><td>Check that addresses to stack memory do not escape the function.</td>
+<td><b>core.StackAddressEscape</b></td><td>Check that addresses to stack memory do not escape the function.</td>
 </tr>
 <tr>
-<td width="20%"><b>core.UndefinedBinaryOperatorResult</b></td><td>Check for undefined results of binary operators.</td>
+<td><b>core.UndefinedBinaryOperatorResult</b></td><td>Check for undefined results of binary operators.</td>
 </tr>
 <tr>
-<td width="20%"><b>core.VLASize</b></td><td>Check for declarations of VLA of undefined or zero size.</td>
+<td><b>core.VLASize</b></td><td>Check for declarations of VLA of undefined or zero size.</td>
 </tr>
 <tr>
-<td width="20%"><b>core.builtin.BuiltinFunctions</b></td><td>Evaluate compiler builtin functions (e.g., alloca()).</td>
+<td><b>core.builtin.BuiltinFunctions</b></td><td>Evaluate compiler builtin functions (e.g., alloca()).</td>
 </tr>
 <tr>
-<td width="20%"><b>core.builtin.NoReturnFunctions</b></td><td>Evaluate "panic" functions that are known to not return to the caller.</td>
+<td><b>core.builtin.NoReturnFunctions</b></td><td>Evaluate "panic" functions that are known to not return to the caller.</td>
 </tr>
 <tr>
-<td width="20%"><b>core.uninitialized.ArraySubscript</b></td><td>Check for uninitialized values used as array subscripts.</td>
+<td><b>core.uninitialized.ArraySubscript</b></td><td>Check for uninitialized values used as array subscripts.</td>
 </tr>
 <tr>
-<td width="20%"><b>core.uninitialized.Assign</b></td><td>Check for assigning uninitialized values.</td>
+<td><b>core.uninitialized.Assign</b></td><td>Check for assigning uninitialized values.</td>
 </tr>
 <tr>
-<td width="20%"><b>core.uninitialized.Branch</b></td><td>Check for uninitialized values used as branch conditions.</td>
+<td><b>core.uninitialized.Branch</b></td><td>Check for uninitialized values used as branch conditions.</td>
 </tr>
 <tr>
-<td width="20%"><b>core.uninitialized.CapturedBlockVariable</b></td><td>Check for blocks that capture uninitialized values.</td>
+<td><b>core.uninitialized.CapturedBlockVariable</b></td><td>Check for blocks that capture uninitialized values.</td>
 </tr>
 <tr>
-<td width="20%"><b>core.uninitialized.UndefReturn</b></td><td>Check for uninitialized values being returned to the caller.</td>
+<td><b>core.uninitialized.UndefReturn</b></td><td>Check for uninitialized values being returned to the caller.</td>
 </tr>
 <tr>
-<td width="20%"><b>deadcode.DeadStores</b></td><td>Check for values stored to variables that are never read afterwards.</td>
+<td><b>deadcode.DeadStores</b></td><td>Check for values stored to variables that are never read afterwards.</td>
 </tr>
 <tr>
-<td width="20%"><b>deadcode.IdempotentOperations</b></td><td>Warn about idempotent operations.</td>
+<td><b>deadcode.IdempotentOperations</b></td><td>Warn about idempotent operations.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.API</b></td><td>Check for proper uses of various Mac OS X APIs.</td>
+<td><b>osx.API</b></td><td>Check for proper uses of various Mac OS X APIs.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.AtomicCAS</b></td><td>Evaluate calls to OSAtomic functions.</td>
+<td><b>osx.AtomicCAS</b></td><td>Evaluate calls to OSAtomic functions.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.SecKeychainAPI</b></td><td>Check for proper uses of Secure Keychain APIs.</td>
+<td><b>osx.SecKeychainAPI</b></td><td>Check for proper uses of Secure Keychain APIs.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.cocoa.AtSync</b></td><td>Check for null pointers used as mutexes for @synchronized.</td>
+<td><b>osx.cocoa.AtSync</b></td><td>Check for null pointers used as mutexes for @synchronized.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.cocoa.ClassRelease</b></td><td>Check for sending 'retain', 'release', or 'autorelease' directly to a Class.</td>
+<td><b>osx.cocoa.ClassRelease</b></td><td>Check for sending 'retain', 'release', or 'autorelease' directly to a Class.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.cocoa.IncompatibleMethodTypes</b></td><td>Warn about Objective-C method signatures with type incompatibilities.</td>
+<td><b>osx.cocoa.IncompatibleMethodTypes</b></td><td>Warn about Objective-C method signatures with type incompatibilities.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.cocoa.NSAutoreleasePool</b></td><td>Warn for suboptimal uses of NSAutoreleasePool in Objective-C GC mode.</td>
+<td><b>osx.cocoa.NSAutoreleasePool</b></td><td>Warn for suboptimal uses of NSAutoreleasePool in Objective-C GC mode.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.cocoa.NSError</b></td><td>Check usage of NSError** parameters.</td>
+<td><b>osx.cocoa.NSError</b></td><td>Check usage of NSError** parameters.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.cocoa.NilArg</b></td><td>Check for prohibited nil arguments to ObjC method calls.</td>
+<td><b>osx.cocoa.NilArg</b></td><td>Check for prohibited nil arguments to ObjC method calls.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.cocoa.RetainCount</b></td><td>Check for leaks and improper reference count management.</td>
+<td><b>osx.cocoa.RetainCount</b></td><td>Check for leaks and improper reference count management.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.cocoa.UnusedIvars</b></td><td>Warn about private ivars that are never used.</td>
+<td><b>osx.cocoa.UnusedIvars</b></td><td>Warn about private ivars that are never used.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.cocoa.VariadicMethodTypes</b></td><td>Check for passing non-Objective-C types to variadic methods that expect only Objective-C types.</td>
+<td><b>osx.cocoa.VariadicMethodTypes</b></td><td>Check for passing non-Objective-C types to variadic methods that expect only Objective-C types.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.coreFoundation.CFError</b></td><td>Check usage of CFErrorRef* parameters.</td>
+<td><b>osx.coreFoundation.CFError</b></td><td>Check usage of CFErrorRef* parameters.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.coreFoundation.CFNumber</b></td><td>Check for proper uses of CFNumberCreate.</td>
+<td><b>osx.coreFoundation.CFNumber</b></td><td>Check for proper uses of CFNumberCreate.</td>
 </tr>
 <tr>
-<td width="20%"><b>osx.coreFoundation.CFRetainRelease</b></td><td>Check for null arguments to CFRetain/CFRelease.</td>
+<td><b>osx.coreFoundation.CFRetainRelease</b></td><td>Check for null arguments to CFRetain/CFRelease.</td>
 </tr>
 <tr>
-<td width="20%"><b>unix.API</b></td><td>Check calls to various UNIX/Posix functions.</td>
+<td><b>unix.API</b></td><td>Check calls to various UNIX/Posix functions.</td>
 </tr>
 </table>
 

Modified: cfe/branches/tooling/www/analyzer/checker_dev_manual.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/analyzer/checker_dev_manual.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/analyzer/checker_dev_manual.html (original)
+++ cfe/branches/tooling/www/analyzer/checker_dev_manual.html Fri Jan 20 10:14:22 2012
@@ -3,8 +3,8 @@
 <html>
 <head>
   <title>Checker Developer Manual</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <script type="text/javascript" src="scripts/menu.js"></script>
 </head>
 <body>
@@ -14,7 +14,7 @@
 
 <div id="content">
 
-<h1><font color=red>This Page Is Under Construction</font></h1>
+<h1 style="color:red">This Page Is Under Construction</h1>
 
 <h1>Checker Developer Manual</h1>
 
@@ -196,7 +196,8 @@
     inter-procedural analysis). Also, it uses a simple range tracking based 
     solver to model symbolic execution.</li>
     
-    <li>Consult the <a href="http://llvm.org/bugs/buglist.cgi?query_format=advanced&bug_status=NEW&bug_status=REOPENED&version=trunk&component=Static%20Analyzer&product=clang">Bugzilla database</a> 
+    <li>Consult the <a
+    href="http://llvm.org/bugs/buglist.cgi?query_format=advanced&bug_status=NEW&bug_status=REOPENED&version=trunk&component=Static%20Analyzer&product=clang">Bugzilla database</a> 
     to get some ideas for new checkers and consider starting with improving/fixing  
     bugs in the existing checkers.</li>
   </ul>
@@ -211,13 +212,13 @@
 using namespace ento;
 
 namespace {
-class NewChecker: public Checker< check::PreStmt<CallExpr> > {
+class NewChecker: public Checker< check::PreStmt<CallExpr> > {
 public:
-  void checkPreStmt(const CallExpr *CE, CheckerContext &Ctx) const {}
+  void checkPreStmt(const CallExpr *CE, CheckerContext &Ctx) const {}
 }
 }
-void ento::registerNewChecker(CheckerManager &mgr) {
-  mgr.registerChecker<NewChecker>();
+void ento::registerNewChecker(CheckerManager &mgr) {
+  mgr.registerChecker<NewChecker>();
 }
 </pre>
 
@@ -333,7 +334,8 @@
 <li>
 To dump AST of a method that the current <tt>ExplodedNode</tt> belongs to:
 <br><tt>
-(gdb) <b>p ENode->getCodeDecl().getBody()->dump(getContext().getSourceManager())</b>
+(gdb) <b>p C.getPredecessor()->getCodeDecl().getBody()->dump()</b>
+(gdb) <b>p C.getPredecessor()->getCodeDecl().getBody()->dump(getContext().getSourceManager())</b>
 </tt>
 </li>
 </ul>

Modified: cfe/branches/tooling/www/analyzer/dev_cxx.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/analyzer/dev_cxx.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/analyzer/dev_cxx.html (original)
+++ cfe/branches/tooling/www/analyzer/dev_cxx.html Fri Jan 20 10:14:22 2012
@@ -3,8 +3,8 @@
 <html>
 <head>
   <title>Analyzer Development: C++ Support</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <script type="text/javascript" src="scripts/menu.js"></script>  
 </head>
 <body>
@@ -31,18 +31,20 @@
 will be added as deemed necessary.</p>
 
 <ul>
-  <li>Control-Flow Graph Enhancements:</li>
+  <li>Control-Flow Graph Enhancements:
   <ul>
     <li>Model C++ destructors</li>
     <li>Model C++ initializers (in constructors)</li>
   </ul>
-  <li>Path-Sensitive Analysis Engine (GRExprEngine):</li>
+  </li>
+  <li>Path-Sensitive Analysis Engine (GRExprEngine):
   <ul>
     <li>Model C++ casts</li>
     <li>Model C++ constructors</li>
     <li>Model C++ destructors</li>
     <li>Model <tt>new</tt> and <tt>delete</tt></li>
   </ul>
+  </li>
 </ul>
 
 </div>

Modified: cfe/branches/tooling/www/analyzer/filing_bugs.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/analyzer/filing_bugs.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/analyzer/filing_bugs.html (original)
+++ cfe/branches/tooling/www/analyzer/filing_bugs.html Fri Jan 20 10:14:22 2012
@@ -3,8 +3,8 @@
 <html>
 <head>
   <title>Filing Bugs and Feature Requests</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <script type="text/javascript" src="scripts/menu.js"></script>  
 </head>
 <body>

Modified: cfe/branches/tooling/www/analyzer/index.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/analyzer/index.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/analyzer/index.html (original)
+++ cfe/branches/tooling/www/analyzer/index.html Fri Jan 20 10:14:22 2012
@@ -3,38 +3,10 @@
 <html>
 <head>
   <title>Clang Static Analyzer</title>
-  <link type="text/css" rel="stylesheet" href="content.css" />
-  <link type="text/css" rel="stylesheet" href="menu.css" />
+  <link type="text/css" rel="stylesheet" href="content.css">
+  <link type="text/css" rel="stylesheet" href="menu.css">
   <script type="text/javascript" src="scripts/menu.js"></script>  
-</head>
-<body>
-
-<div id="page">
-<!--#include virtual="menu.html.incl"-->
-<div id="content">
-
-
-<table style="margin-top:0px" width="100%" border="0" cellpadding="0px" cellspacing="0">
-<tr><td>
-
-<h1>Clang Static Analyzer</h1>  
-
-<p>The Clang Static Analyzer is source code analysis tool that find bugs in C
-and Objective-C programs.</p>
-
-<p>Currently it can be run either as a <a href="/scan-build.html">standalone
-tool</a> or <a href="/xcode.html">within Xcode</a>. The standalone tool is
-invoked from the command-line, and is intended to be run in tandem with a build
-of a codebase.</p>
-
-<p>The analyzer is 100% open source and is part of the <a
-href="http://clang.llvm.org">Clang</a> project. Like the rest of Clang, the
-analyzer is implemented as a C++ library that can be used by other tools and
-applications.</p>
-
-<h2>Download</h2>
-
-<!-- Generated from: http://www.spiffycorners.com/index.php -->
+  <!-- Generated from: http://www.spiffycorners.com/index.php -->
 
 <style type="text/css">
 .spiffy{display:block}
@@ -77,15 +49,40 @@
 .spiffyfg h2 {
   margin:0px;  padding:10px;
 }
-</style>
 
-<style type="text/css">
   #left { float:left; }
   #left h2 { margin:1px; padding-top:0px; }
   #right { float:left; margin-left:20px; margin-right:20px; padding:0px ;}
   #right h2 { padding:0px; margin:0px; }
   #wrappedcontent { padding:15px;}
 </style>
+</head>
+<body>
+
+<div id="page">
+<!--#include virtual="menu.html.incl"-->
+<div id="content">
+
+
+<table style="margin-top:0px" width="100%" border="0" cellpadding="0px" cellspacing="0">
+<tr><td>
+
+<h1>Clang Static Analyzer</h1>  
+
+<p>The Clang Static Analyzer is source code analysis tool that find bugs in C
+and Objective-C programs.</p>
+
+<p>Currently it can be run either as a <a href="/scan-build.html">standalone
+tool</a> or <a href="/xcode.html">within Xcode</a>. The standalone tool is
+invoked from the command-line, and is intended to be run in tandem with a build
+of a codebase.</p>
+
+<p>The analyzer is 100% open source and is part of the <a
+href="http://clang.llvm.org">Clang</a> project. Like the rest of Clang, the
+analyzer is implemented as a C++ library that can be used by other tools and
+applications.</p>
+
+<h2>Download</h2>
 
 <div style="padding:0px; font-size: 90%">
  <b class="spiffy">
@@ -101,7 +98,7 @@
     <li>Latest build (Intel-only binary, 10.5+):<br>
      <!--#include virtual="latest_checker.html.incl"-->
     </li>
-    <li><a href="/release_notes.html">Release notes</a></li></li>
+    <li><a href="/release_notes.html">Release notes</a></li>
     <li>This build can be used both from the command line and from within Xcode</li>
     <li><a href="/installation.html">Installation</a> and <a href="/scan-build.html">usage</a></li>
    </ul>
@@ -140,10 +137,10 @@
 
 
 </td><td style="padding-left:10px">
-<a href="images/analyzer_xcode.png"><img src="images/analyzer_xcode.png" width="450x" border=0></a>
-<center><b>Viewing static analyzer results in Xcode 3.2</b></center>
-<a href="images/analyzer_html.png"><img src="images/analyzer_html.png" width="450px" border=0></a>
-<center><b>Viewing static analyzer results in a web browser</b></center>
+<a href="images/analyzer_xcode.png"><img src="images/analyzer_xcode.png" width="450" alt="analyzer in xcode"></a>
+<div style="text-align:center"><b>Viewing static analyzer results in Xcode 3.2</b></div>
+<a href="images/analyzer_html.png"><img src="images/analyzer_html.png" width="450" alt="analyzer in browser"></a>
+<div style="text-align:center"><b>Viewing static analyzer results in a web browser</b></div>
 </td></tr></table>
 
 <h2 id="StaticAnalysis">What is Static Analysis?</h2>
@@ -198,7 +195,7 @@
 
 <p>The Clang Static Analyzer runs in a reasonable amount of time by both
 bounding the amount of checking work it will do as well as using clever
-algorithms to reduce the amount of work it must do to find bugs.</p></li>
+algorithms to reduce the amount of work it must do to find bugs.</p>
 
 <h3>False Positives</h3>
 

Modified: cfe/branches/tooling/www/analyzer/installation.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/analyzer/installation.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/analyzer/installation.html (original)
+++ cfe/branches/tooling/www/analyzer/installation.html Fri Jan 20 10:14:22 2012
@@ -3,8 +3,8 @@
 <html>
 <head>
   <title>Obtaining the Static Analyzer</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <script type="text/javascript" src="scripts/menu.js"></script>  
 </head>
 <body>

Modified: cfe/branches/tooling/www/analyzer/release_notes.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/analyzer/release_notes.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/analyzer/release_notes.html (original)
+++ cfe/branches/tooling/www/analyzer/release_notes.html Fri Jan 20 10:14:22 2012
@@ -3,8 +3,8 @@
 <html>
 <head>
   <title>Release notes for checker-XXX builds</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <script type="text/javascript" src="scripts/menu.js"></script>
 </head>
 <body>

Modified: cfe/branches/tooling/www/analyzer/scan-build.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/analyzer/scan-build.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/analyzer/scan-build.html (original)
+++ cfe/branches/tooling/www/analyzer/scan-build.html Fri Jan 20 10:14:22 2012
@@ -3,8 +3,8 @@
 <html>
 <head>
   <title>scan-build: running the analyzer from the command line</title>
-  <link type="text/css" rel="stylesheet" href="content.css" />
-  <link type="text/css" rel="stylesheet" href="menu.css" />
+  <link type="text/css" rel="stylesheet" href="content.css">
+  <link type="text/css" rel="stylesheet" href="menu.css">
   <script type="text/javascript" src="scripts/menu.js"></script>
   <script type="text/javascript" src="scripts/dbtree.js"></script>
 </head>
@@ -16,7 +16,7 @@
 
 <h1>scan-build: running the analyzer from the command line</h1>
 
-<table style="margin-top:0px" width="100%" border="0" cellpadding="0px" cellspacing="0">
+<table style="margin-top:0px" width="100%" cellpadding="0px" cellspacing="0">
 <tr><td>
 
 <h3>What is it?</h3>
@@ -35,9 +35,9 @@
 <p><b>scan-build</b> has little or no knowledge about how you build your code.
 It works by overriding the <tt>CC</tt> and <tt>CXX</tt> environment variables to
 (hopefully) change your build to use a "fake" compiler instead of the
-one that would normally build your project. By default, this fake compiler
-executes <tt>gcc</tt> to compile your code (assuming that <tt>gcc</tt> is your
-compiler) and then executes the static analyzer to analyze your code.</p>
+one that would normally build your project. This fake compiler executes either 
+<tt>clang</tt> or <tt>gcc</tt> (depending on the platform) to compile your 
+code and then executes the static analyzer to analyze your code.</p>
 
 <p>This "poor man's interposition" works amazingly well in many cases
 and falls down in others. Please consult the information on this page on making
@@ -45,11 +45,10 @@
 aforementioned hack fails to work.</p>
 
 </td>
-<td style="padding-left:10px">
-<center>
-  <img src="images/scan_build_cmd.png" width="450px" border=0><br>
-  <a href="images/analyzer_html.png"><img src="images/analyzer_html.png" width="450px" border=0></a>
-<br><b>Viewing static analyzer results in a web browser</b></center>
+<td style="padding-left:10px; text-align:center">
+  <img src="images/scan_build_cmd.png" width="450px" alt="scan-build"><br>
+  <a href="images/analyzer_html.png"><img src="images/analyzer_html.png" width="450px" alt="analyzer in browser"></a>
+<br><b>Viewing static analyzer results in a web browser</b>
 </td></tr></table>
 
 <h2>Contents</h2>
@@ -77,8 +76,8 @@
 <p>The <tt>scan-build</tt> command can be used to analyze an entire project by
 essentially interposing on a project's build process. This means that to run the
 analyzer using <tt>scan-build</tt>, you will use <tt>scan-build</tt> to analyze
-the source files compiled by <tt>gcc</tt> during a project build. This means
-that any files that are not compiled will also not be analyzed.</p>
+the source files compiled by <tt>gcc</tt>/<tt>clang</tt> during a project build. 
+This means that any files that are not compiled will also not be analyzed.</p>
 
 <h3 id="scanbuild_basicusage">Basic Usage</h3>
 
@@ -101,7 +100,7 @@
 </pre>
 
 <p>Operationally, <tt>scan-build</tt> literally runs <command> with all of the
-subsequent options passed to it. For example, one can pass <nobr><tt>-j4</tt></nobr> to
+subsequent options passed to it. For example, one can pass <tt>-j4</tt> to
 <tt>make</tt> get a parallel build over 4 cores:</p>
 
 <pre class="code_example">
@@ -141,17 +140,17 @@
 <tr><td><b>-o</b></td><td>Target directory for HTML report files. Subdirectories
 will be created as needed to represent separate "runs" of the analyzer. If this
 option is not specified, a directory is created in <tt>/tmp</tt> to store the
-reports.</td><tr>
+reports.</td></tr>
 
-<tr><td><b>-h</b><br><i><nobr>(or no arguments)</nobr></i></td><td>Display all
+<tr><td><b>-h</b><br><i>(or no arguments)</i></td><td>Display all
 <tt>scan-build</tt> options.</td></tr>
 
-<tr><td><b>-k</b><br><nobr><b>--keep-going</b></nobr></td><td>Add a "keep on
+<tr><td><b>-k</b><br><b>--keep-going</b></td><td>Add a "keep on
 going" option to the specified build command. <p>This option currently supports
 <tt>make</tt> and <tt>xcodebuild</tt>.</p> <p>This is a convenience option; one
 can specify this behavior directly using build options.</p></td></tr>
 
-<tr><td><b>-v<b></td><td>Verbose output from scan-build and the analyzer. <b>A
+<tr><td><b>-v</b></td><td>Verbose output from scan-build and the analyzer. <b>A
 second and third "-v" increases verbosity</b>, and is useful for filing bug
 reports against the analyzer.</td></tr>
 
@@ -217,12 +216,12 @@
 <i>interposing</i> on the compiler. This interposition is currently done by
 <tt>scan-build</tt> temporarily setting the environment variable <tt>CC</tt> to
 <tt>ccc-analyzer</tt>. The program <tt>ccc-analyzer</tt> acts like a fake
-compiler, forwarding its command line arguments over to <tt>gcc</tt> to perform
+compiler, forwarding its command line arguments over to the compiler to perform
 regular compilation and <tt>clang</tt> to perform static analysis.</p>
 
 <p>Running <tt>configure</tt> typically generates makefiles that have hardwired
 paths to the compiler, and by running <tt>configure</tt> through
-<tt>scan-build</tt> that path is set to <tt>ccc-analyzer</tt>.</p.>
+<tt>scan-build</tt> that path is set to <tt>ccc-analyzer</tt>.</p>
 
 <!-- 
 <h2 id="Debugging">Debugging the Analyzer</h2>
@@ -314,18 +313,17 @@
 
 <h3>Gotcha: using the right compiler</h3>
 
-<p>Recall that <b>scan-build</b> analyzes your project by using <tt>gcc</tt> to
-compile the project and <tt>clang</tt> to analyze your project. When analyzing
+<p>Recall that <b>scan-build</b> analyzes your project by using a compiler to
+compile the project and <tt>clang</tt> to analyze your project. The script uses 
+simple heuristics to determine which compiler should be used (it defaults to 
+<tt>clang</tt> on Darwin and <tt>gcc</tt> on other platforms). When analyzing
 iPhone projects, <b>scan-build</b> may pick the wrong compiler than the one
-Xcode would use to build your project. This is because multiple versions of
-<tt>gcc</tt> may be installed on your system, especially if you are developing
-for the iPhone.</p>
-
-<p>Where this particularly might be a problem is if you are using Mac OS 10.5
-(Leopard) to develop for iPhone OS 3.0. The default desktop compiler on Leopard
-is gcc-4.0, while the compiler for iPhone OS 3.0 is gcc-4.2. When compiling your
-application to run on the simulator, it is important that <b>scan-build</b>
-finds the correct version of <tt>gcc</tt>. Otherwise, you may see strange build
+Xcode would use to build your project. For example, this could be because 
+multiple versions of a compiler may be installed on your system, especially if 
+you are developing for the iPhone.</p>
+
+<p>When compiling your application to run on the simulator, it is important that <b>scan-build</b>
+finds the correct version of <tt>gcc/clang</tt>. Otherwise, you may see strange build
 errors that only happen when you run <tt>scan-build</tt>.
 
 <p><b>scan-build</b> provides the <tt>--use-cc</tt> and <tt>--use-c++</tt>

Modified: cfe/branches/tooling/www/analyzer/xcode.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/analyzer/xcode.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/analyzer/xcode.html (original)
+++ cfe/branches/tooling/www/analyzer/xcode.html Fri Jan 20 10:14:22 2012
@@ -3,8 +3,8 @@
 <html>
 <head>
   <title>Build and Analyze: running the analyzer within Xcode</title>
-  <link type="text/css" rel="stylesheet" href="content.css" />
-  <link type="text/css" rel="stylesheet" href="menu.css" />
+  <link type="text/css" rel="stylesheet" href="content.css">
+  <link type="text/css" rel="stylesheet" href="menu.css">
   <script type="text/javascript" src="scripts/menu.js"></script>
   <script type="text/javascript" src="scripts/dbtree.js"></script>  
 </head>
@@ -33,10 +33,9 @@
 <p><b>Yes</b>. Instructions are included below.</p>
 
 </td>
-<td style="padding-left:10px">
-<center>
-  <a href="images/analyzer_xcode.png"><img src="images/analyzer_xcode.png" width="620px" border=0></a>
-<br><b>Viewing static analyzer results in Xcode</b></center>
+<td style="padding-left:10px; text-align:center">
+  <a href="images/analyzer_xcode.png"><img src="images/analyzer_xcode.png" width="620px" alt="analyzer in xcode"></a>
+<br><b>Viewing static analyzer results in Xcode</b>
 </td></tr></table>
 
 <h3>Key features:</h3>

Modified: cfe/branches/tooling/www/clang_video-05-25-2007.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/clang_video-05-25-2007.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/clang_video-05-25-2007.html (original)
+++ cfe/branches/tooling/www/clang_video-05-25-2007.html Fri Jan 20 10:14:22 2012
@@ -2,10 +2,10 @@
 <!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
 <html>
 <head>
-	<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+	<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 	<title>2007 LLVM Developer's Meeting</title>
-	<link type="text/css" rel="stylesheet" href="menu.css" />
-	<link type="text/css" rel="stylesheet" href="content.css" />
+	<link type="text/css" rel="stylesheet" href="menu.css">
+	<link type="text/css" rel="stylesheet" href="content.css">
 </head>
 <body>
 	<!--#include virtual="menu.html.incl"-->

Modified: cfe/branches/tooling/www/clang_video-07-25-2007.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/clang_video-07-25-2007.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/clang_video-07-25-2007.html (original)
+++ cfe/branches/tooling/www/clang_video-07-25-2007.html Fri Jan 20 10:14:22 2012
@@ -2,10 +2,10 @@
 <!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
 <html>
 <head>
-	<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+	<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 	<title>LLVM 2.0 and Beyond!</title>
-	<link type="text/css" rel="stylesheet" href="menu.css" />
-	<link type="text/css" rel="stylesheet" href="content.css" />
+	<link type="text/css" rel="stylesheet" href="menu.css">
+	<link type="text/css" rel="stylesheet" href="content.css">
 </head>
 <body>
 	<!--#include virtual="menu.html.incl"-->

Modified: cfe/branches/tooling/www/comparison.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/comparison.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/comparison.html (original)
+++ cfe/branches/tooling/www/comparison.html Fri Jan 20 10:14:22 2012
@@ -3,10 +3,10 @@
 <!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
 <html>
 <head>
-  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Comparing clang to other open source compilers</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
 </head>
 <body>
   <!--#include virtual="menu.html.incl"-->
@@ -183,6 +183,7 @@
         inefficient code and does not support many important targets.</li>
     <li>Like Elsa, PCC's does not have an integrated preprocessor, making it
         extremely difficult to use it for source analysis tools.</li>
+    </ul>
   </div>
 </body>
 </html>

Modified: cfe/branches/tooling/www/compatibility.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/compatibility.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/compatibility.html (original)
+++ cfe/branches/tooling/www/compatibility.html Fri Jan 20 10:14:22 2012
@@ -2,10 +2,10 @@
           "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
-  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Language Compatibility</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <style type="text/css">
 </style>
 </head>
@@ -47,7 +47,7 @@
       <li><a href="#c_variables-class">C variables in @class or @protocol</a></li>
     </ul>
   </li>
-  <li><a href="#c++">C++ compatibility</a>
+  <li><a href="#cxx">C++ compatibility</a>
     <ul>
       <li><a href="#vla">Variable-length arrays</a></li>
       <li><a href="#dep_lookup">Unqualified lookup in templates</a></li>
@@ -60,13 +60,13 @@
       <li><a href="#param_name_lookup">Parameter name lookup</a></li>
     </ul>
   </li>
-  <li><a href="#c++11">C++11 compatibility</a>
+  <li><a href="#cxx11">C++11 compatibility</a>
     <ul>
       <li><a href="#deleted-special-func">Deleted special member
   functions</a></li>
     </ul>
   </li>
-  <li><a href="#objective-c++">Objective-C++ compatibility</a>
+  <li><a href="#objective-cxx">Objective-C++ compatibility</a>
     <ul>
       <li><a href="#implicit-downcasts">Implicit downcasts</a></li>
     </ul>
@@ -77,7 +77,7 @@
 </ul>
 
 <!-- ======================================================================= -->
-<h2 id="c">C compatibility</h3>
+<h2 id="c">C compatibility</h2>
 <!-- ======================================================================= -->
 
 <!-- ======================================================================= -->
@@ -318,7 +318,7 @@
 this makes your code more clear and is compatible with both GCC and Clang.</p>
 
 <!-- ======================================================================= -->
-<h2 id="objective-c">Objective-C compatibility</h3>
+<h2 id="objective-c">Objective-C compatibility</h2>
 <!-- ======================================================================= -->
 
 <!-- ======================================================================= -->
@@ -409,7 +409,7 @@
 </pre>
 
 <!-- ======================================================================= -->
-<h2 id="c++">C++ compatibility</h3>
+<h2 id="cxx">C++ compatibility</h2>
 <!-- ======================================================================= -->
 
 <!-- ======================================================================= -->
@@ -761,7 +761,7 @@
 <p>Clang diagnoses this error (where the parameter name has been redeclared). To fix this problem, rename one of the parameters.</p>
 
 <!-- ======================================================================= -->
-<h2 id="c++11">C++11 compatibility</h2>
+<h2 id="cxx11">C++11 compatibility</h2>
 <!-- ======================================================================= -->
 
 <!-- ======================================================================= -->
@@ -769,7 +769,7 @@
 <!-- ======================================================================= -->
 
 <p>In C++11, the explicit declaration of a move constructor or a move
-assignment operator within a class disables the implicit declaration
+assignment operator within a class deletes the implicit declaration
 of the copy constructor and copy assignment operator. This change came
 fairly late in the C++11 standardization process, so early
 implementations of C++11 (including Clang before 3.0, GCC before 4.7,
@@ -778,22 +778,23 @@
 
 <pre>
 struct X {
-  X(X&&); <i>// suppresses implicit copy constructor</i>
+  X(X&&); <i>// deletes implicit copy constructor:</i>
+  <i>// X(const X&) = delete;</i>
 };
 
 void f(X x);
 void g(X x) {
-  f(x); <i>// error: X has no copy constructor</i>
+  f(x); <i>// error: X has a deleted copy constructor</i>
 }
 </pre>
 
-<p>This affects some C++11 code, including Boost's popular <a
+<p>This affects some early C++11 code, including Boost's popular <a
 href="http://www.boost.org/doc/libs/release/libs/smart_ptr/shared_ptr.htm"><tt>shared_ptr</tt></a>
 up to version 1.47.0. The fix for Boost's <tt>shared_ptr</tt> is
 <a href="https://svn.boost.org/trac/boost/changeset/73202">available here</a>.</p>
 
 <!-- ======================================================================= -->
-<h2 id="objective-c++">Objective-C++ compatibility</h2>
+<h2 id="objective-cxx">Objective-C++ compatibility</h2>
 <!-- ======================================================================= -->
 
 <!-- ======================================================================= -->
@@ -859,7 +860,7 @@
 @implementation  I
 - (int) Meth { return I.class; }
 @end
-<pre>
+</pre>
 
 <p>Use explicit message-send syntax instead, i.e. <code>[I class]</code>.</p>
 

Modified: cfe/branches/tooling/www/cxx_compatibility.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/cxx_compatibility.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/cxx_compatibility.html (original)
+++ cfe/branches/tooling/www/cxx_compatibility.html Fri Jan 20 10:14:22 2012
@@ -3,10 +3,10 @@
 <html>
 <head>
 <meta HTTP-EQUIV="REFRESH" content="5; url=compatibility.html#c++">
-  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Clang - C++ Compatibility</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <style type="text/css">
 </style>
 </head>

Modified: cfe/branches/tooling/www/diagnostics.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/diagnostics.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/diagnostics.html (original)
+++ cfe/branches/tooling/www/diagnostics.html Fri Jan 20 10:14:22 2012
@@ -4,10 +4,14 @@
 <head>
   <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
   <title>Clang - Expressive Diagnostics</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <style type="text/css">
-</style>
+  .warn { color:magenta; }
+  .err { color:red; }
+  .snip { color:darkgreen; }
+  .point { color:blue; }
+  </style>
 </head>
 <body>
 
@@ -35,14 +39,14 @@
 
 <p>First, all diagnostics produced by clang include full column number
 information. The clang command-line compiler driver uses this information
-to print "caret diagnostics".
+to print "point diagnostics".
 (IDEs can use the information to display in-line error markup.)
 Precise error location in the source is a feature provided by many commercial
 compilers, but is generally missing from open source
 compilers.  This is nice because it makes it very easy to understand exactly
 what is wrong in a particular piece of code</p>
 
-<p>The caret (the blue "^" character) exactly shows where the problem is, even
+<p>The point (the blue "^" character) exactly shows where the problem is, even
 inside of a string.  This makes it really easy to jump to the problem and
 helps when multiple instances of the same character occur on a line. (We'll 
 revisit this more in following examples.)</p>
@@ -51,9 +55,9 @@
   $ <b>gcc-4.2 -fsyntax-only -Wformat format-strings.c</b>
   format-strings.c:91: warning: too few arguments for format
   $ <b>clang -fsyntax-only format-strings.c</b>
-  format-strings.c:91:13: <font color="magenta">warning:</font> '.*' specified field precision is missing a matching 'int' argument
-  <font color="darkgreen">  printf("%.*d");</font>
-  <font color="blue">            ^</font>
+  format-strings.c:91:13: <span class="warn">warning:</span> '.*' specified field precision is missing a matching 'int' argument
+  <span class="snip">  printf("%.*d");</span>
+  <span class="point">            ^</span>
 </pre>
 
 <h2>Range Highlighting for Related Text</h2>
@@ -63,7 +67,7 @@
 diagnostics highlight related information.  In the following somewhat
 nonsensical example you can see that you don't even need to see the original source code to
 understand what is wrong based on the Clang error. Because clang prints a
-caret, you know exactly <em>which</em> plus it is complaining about.  The range
+point, you know exactly <em>which</em> plus it is complaining about.  The range
 information highlights the left and right side of the plus which makes it
 immediately obvious what the compiler is talking about.
 Range information is very useful for
@@ -73,9 +77,9 @@
   $ <b>gcc-4.2 -fsyntax-only t.c</b>
   t.c:7: error: invalid operands to binary + (have 'int' and 'struct A')
   $ <b>clang -fsyntax-only t.c</b>
-  t.c:7:39: <font color="red">error:</font> invalid operands to binary expression ('int' and 'struct A')
-  <font color="darkgreen">  return y + func(y ? ((SomeA.X + 40) + SomeA) / 42 + SomeA.X : SomeA.X);</font>
-  <font color="blue">                       ~~~~~~~~~~~~~~ ^ ~~~~~</font>
+  t.c:7:39: <span class="err">error:</span> invalid operands to binary expression ('int' and 'struct A')
+  <span class="snip">  return y + func(y ? ((SomeA.X + 40) + SomeA) / 42 + SomeA.X : SomeA.X);</span>
+  <span class="point">                       ~~~~~~~~~~~~~~ ^ ~~~~~</span>
 </pre>
 
 <h2>Precision in Wording</h2>
@@ -84,7 +88,7 @@
 out of clang contain exactly the pertinent information about what is wrong and
 why.  In the example above, we tell you what the inferred types are for
 the left and right hand sides, and we don't repeat what is obvious from the
-caret (e.g., that this is a "binary +").</p>
+point (e.g., that this is a "binary +").</p>
 
 <p>Many other examples abound. In the following example, not only do we tell you that there is a problem with the *
 and point to it, we say exactly why and tell you what the type is (in case it is
@@ -96,9 +100,9 @@
   $ <b>gcc-4.2 -fsyntax-only t.c</b>
   t.c:5: error: invalid type argument of 'unary *'
   $ <b>clang -fsyntax-only t.c</b>
-  t.c:5:11: <font color="red">error:</font> indirection requires pointer operand ('int' invalid)
-  <font color="darkgreen">  int y = *SomeA.X;</font>
-  <font color="blue">          ^~~~~~~~</font>
+  t.c:5:11: <span class="err">error:</span> indirection requires pointer operand ('int' invalid)
+  <span class="snip">  int y = *SomeA.X;</span>
+  <span class="point">          ^~~~~~~~</span>
 </pre>
 
 <h2>No Pretty Printing of Expressions in Diagnostics</h2>
@@ -111,9 +115,9 @@
   $ <b>gcc-4.2 -fsyntax-only t.c</b>
   #'exact_div_expr' not supported by pp_c_expression#'t.c:12: error: called object  is not a function
   $ <b>clang -fsyntax-only t.c</b>
-  t.c:12:8: <font color="red">error:</font> called object type 'int' is not a function or function pointer
-  <font color="darkgreen">  (P-Q)();</font>
-  <font color="blue">  ~~~~~^</font>
+  t.c:12:8: <span class="err">error:</span> called object type 'int' is not a function or function pointer
+  <span class="snip">  (P-Q)();</span>
+  <span class="point">  ~~~~~^</span>
 </pre>
 
 <p>This can be particularly bad in G++, which often emits errors
@@ -136,9 +140,9 @@
   t.cc:9: error: no match for 'operator+' in '(((a*)P) + (*(long int*)(P->foo::<anonymous>.a::_vptr$a + -0x00000000000000020)))->a::bar() + * P'
   t.cc:9: error: return-statement with a value, in function returning 'void'
   $ <b>clang t.cc</b>
-  t.cc:9:18: <font color="red">error:</font> invalid operands to binary expression ('int' and 'foo')
-  <font color="darkgreen">  return P->bar() + *P;</font>
-  <font color="blue">         ~~~~~~~~ ^ ~~</font>
+  t.cc:9:18: <span class="err">error:</span> invalid operands to binary expression ('int' and 'foo')
+  <span class="snip">  return P->bar() + *P;</span>
+  <span class="point">         ~~~~~~~~ ^ ~~</span>
 </pre>
   
 
@@ -160,9 +164,9 @@
   $ <b>gcc-4.2 -fsyntax-only t.c</b>
   t.c:15: error: invalid operands to binary / (have 'float __vector__' and 'const int *')
   $ <b>clang -fsyntax-only t.c</b>
-  t.c:15:11: <font color="red">error:</font> can't convert between vector values of different size ('__m128' and 'int const *')
-  <font color="darkgreen">  myvec[1]/P;</font>
-  <font color="blue">  ~~~~~~~~^~</font>
+  t.c:15:11: <span class="err">error:</span> can't convert between vector values of different size ('__m128' and 'int const *')
+  <span class="snip">  myvec[1]/P;</span>
+  <span class="point">  ~~~~~~~~^~</span>
 </pre>
 
 <p>The following example shows where it is useful for the compiler to expose
@@ -173,9 +177,9 @@
   $ <b>gcc-4.2 -fsyntax-only t.c</b>
   t.c:13: error: request for member 'x' in something not a structure or union
   $ <b>clang -fsyntax-only t.c</b>
-  t.c:13:9: <font color="red">error:</font> member reference base type 'pid_t' (aka 'int') is not a structure or union
-  <font color="darkgreen">  myvar = myvar.x;</font>
-  <font color="blue">          ~~~~~ ^</font>
+  t.c:13:9: <span class="err">error:</span> member reference base type 'pid_t' (aka 'int') is not a structure or union
+  <span class="snip">  myvar = myvar.x;</span>
+  <span class="point">          ~~~~~ ^</span>
 </pre>
 
 <p>In C++, type preservation includes retaining any qualification written into type names. For example, if we take a small snippet of code such as:
@@ -204,9 +208,9 @@
   $ <b>g++-4.2 -fsyntax-only t.cpp</b>
   t.cpp:9: error: no match for 'operator+=' in 'server += http'
   $ <b>clang -fsyntax-only t.cpp</b>
-  t.cpp:9:10: <font color="red">error:</font> invalid operands to binary expression ('servers::Server const' and '::services::WebService const *')
-    <font color="darkgreen">server += http;</font>
-    <font color="blue">~~~~~~ ^  ~~~~</font>
+  t.cpp:9:10: <span class="err">error:</span> invalid operands to binary expression ('servers::Server const' and '::services::WebService const *')
+    <span class="snip">server += http;</span>
+    <span class="point">~~~~~~ ^  ~~~~</span>
 </pre>
 
 <p>Naturally, type preservation extends to uses of templates, and Clang retains information about how a particular template specialization (like <code>std::vector<Real></code>) was spelled within the source code. For example:</p>
@@ -215,9 +219,9 @@
   $ <b>g++-4.2 -fsyntax-only t.cpp</b>
   t.cpp:12: error: no match for 'operator=' in 'str = vec'
   $ <b>clang -fsyntax-only t.cpp</b>
-  t.cpp:12:7: <font color="red">error:</font> incompatible type assigning 'vector<Real>', expected 'std::string' (aka 'class std::basic_string<char>')
-    <font color="darkgreen">str = vec</font>;
-        <font color="blue">^ ~~~</font>
+  t.cpp:12:7: <span class="err">error:</span> incompatible type assigning 'vector<Real>', expected 'std::string' (aka 'class std::basic_string<char>')
+    <span class="snip">str = vec</span>;
+        <span class="point">^ ~~~</span>
 </pre>
 
 <h2>Fix-it Hints</h2>
@@ -230,18 +234,18 @@
 problem. In the following example, Clang warns about the use of a GCC
 extension that has been considered obsolete since 1993. The underlined
 code should be removed, then replaced with the code below the
-caret line (".x =" or ".y =", respectively).</p>
+point line (".x =" or ".y =", respectively).</p>
 
 <pre>
   $ <b>clang t.c</b>
-  t.c:5:28: <font color="magenta">warning:</font> use of GNU old-style field designator extension
-  <font color="darkgreen">struct point origin = { x: 0.0, y: 0.0 };</font>
-                          <font color="red">~~</font> <font color="blue">^</font>
-                          <font color="darkgreen">.x = </font>
-  t.c:5:36: <font color="magenta">warning:</font> use of GNU old-style field designator extension
-  <font color="darkgreen">struct point origin = { x: 0.0, y: 0.0 };</font>
-                                  <font color="red">~~</font> <font color="blue">^</font>
-                                  <font color="darkgreen">.y = </font>
+  t.c:5:28: <span class="warn">warning:</span> use of GNU old-style field designator extension
+  <span class="snip">struct point origin = { x: 0.0, y: 0.0 };</span>
+                          <span class="err">~~</span> <span class="point">^</span>
+                          <span class="snip">.x = </span>
+  t.c:5:36: <span class="warn">warning:</span> use of GNU old-style field designator extension
+  <span class="snip">struct point origin = { x: 0.0, y: 0.0 };</span>
+                                  <span class="err">~~</span> <span class="point">^</span>
+                                  <span class="snip">.y = </span>
 </pre>
 
 <p>"Fix-it" hints are most useful for
@@ -253,10 +257,10 @@
 
 <pre>
   $ <b>clang t.cpp</b>
-  t.cpp:9:3: <font color="red">error:</font> template specialization requires 'template<>'
+  t.cpp:9:3: <span class="err">error:</span> template specialization requires 'template<>'
     struct iterator_traits<file_iterator> {
-    <font color="blue">^</font>
-    <font color="darkgreen">template<> </font>
+    <span class="point">^</span>
+    <span class="snip">template<> </span>
 </pre>
 
 <h2>Automatic Macro Expansion</h2>
@@ -273,12 +277,12 @@
   t.c: In function 'test':
   t.c:80: error: invalid operands to binary < (have 'struct mystruct' and 'float')
   $ <b>clang -fsyntax-only t.c</b>
-  t.c:80:3: <font color="red">error:</font> invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
-  <font color="darkgreen">  X = MYMAX(P, F);</font>
-  <font color="blue">      ^~~~~~~~~~~</font>
+  t.c:80:3: <span class="err">error:</span> invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
+  <span class="snip">  X = MYMAX(P, F);</span>
+  <span class="point">      ^~~~~~~~~~~</span>
   t.c:76:94: note: instantiated from:
-  <font color="darkgreen">#define MYMAX(A,B)    __extension__ ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })</font>
-  <font color="blue">                                                                                         ~~~ ^ ~~~</font>
+  <span class="snip">#define MYMAX(A,B)    __extension__ ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })</span>
+  <span class="point">                                                                                         ~~~ ^ ~~~</span>
 </pre>
 
 <p>Here's another real world warning that occurs in the "window" Unix package (which
@@ -286,15 +290,15 @@
 
 <pre>
   $ <b>clang -fsyntax-only t.c</b>
-  t.c:22:2: <font color="magenta">warning:</font> type specifier missing, defaults to 'int'
-  <font color="darkgreen">        ILPAD();</font>
-  <font color="blue">        ^</font>
+  t.c:22:2: <span class="warn">warning:</span> type specifier missing, defaults to 'int'
+  <span class="snip">        ILPAD();</span>
+  <span class="point">        ^</span>
   t.c:17:17: note: instantiated from:
-  <font color="darkgreen">#define ILPAD() PAD((NROW - tt.tt_row) * 10)    /* 1 ms per char */</font>
-  <font color="blue">                ^</font>
+  <span class="snip">#define ILPAD() PAD((NROW - tt.tt_row) * 10)    /* 1 ms per char */</span>
+  <span class="point">                ^</span>
   t.c:14:2: note: instantiated from:
-  <font color="darkgreen">        register i; \</font>
-  <font color="blue">        ^</font>
+  <span class="snip">        register i; \</span>
+  <span class="point">        ^</span>
 </pre>
 
 <p>In practice, we've found that Clang's treatment of macros is actually more useful in multiply nested
@@ -308,7 +312,7 @@
 <p>The following example shows a trivial little tweak, where we tell you to put the semicolon at
 the end of the line that is missing it (line 4) instead of at the beginning of
 the following line (line 5).  This is particularly important with fixit hints
-and caret diagnostics, because otherwise you don't get the important context.
+and point diagnostics, because otherwise you don't get the important context.
 </p>
 
 <pre>
@@ -316,10 +320,10 @@
   t.c: In function 'foo':
   t.c:5: error: expected ';' before '}' token
   $ <b>clang t.c</b>
-  t.c:4:8: <font color="red">error:</font> expected ';' after expression
-  <font color="darkgreen">  bar()</font>
-  <font color="blue">       ^</font>
-  <font color="blue">       ;</font>
+  t.c:4:8: <span class="err">error:</span> expected ';' after expression
+  <span class="snip">  bar()</span>
+  <span class="point">       ^</span>
+  <span class="point">       ;</span>
 </pre>
 
 <p>The following example shows much better error recovery than GCC. The message coming out
@@ -330,9 +334,9 @@
   $ <b>gcc-4.2 t.c</b>
   t.c:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
   $ <b>clang t.c</b>
-  t.c:3:1: <font color="red">error:</font> unknown type name 'foo_t'
-  <font color="darkgreen">foo_t *P = 0;</font>
-  <font color="blue">^</font>
+  t.c:3:1: <span class="err">error:</span> unknown type name 'foo_t'
+  <span class="snip">foo_t *P = 0;</span>
+  <span class="point">^</span>
 </pre>
 
 <p>The following example shows that we recover from the simple case of
@@ -352,14 +356,14 @@
   t.cc:4: error: invalid type in declaration before ';' token
   t.cc:6: error: expected unqualified-id at end of input
   $ <b>clang t.cc</b>
-  t.cc:2:11: <font color="red">error:</font> expected ';' after class
-  <font color="darkgreen">class a {}</font>
-  <font color="blue">          ^</font>
-  <font color="blue">          ;</font>
-  t.cc:6:2: <font color="red">error:</font> expected ';' after struct
-  <font color="darkgreen">}</font>
-  <font color="blue"> ^</font>
-  <font color="blue"> ;</font>
+  t.cc:2:11: <span class="err">error:</span> expected ';' after class
+  <span class="snip">class a {}</span>
+  <span class="point">          ^</span>
+  <span class="point">          ;</span>
+  t.cc:6:2: <span class="err">error:</span> expected ';' after struct
+  <span class="snip">}</span>
+  <span class="point"> ^</span>
+  <span class="point"> ;</span>
 </pre>
 
 <p>While each of these details is minor, we feel that they all add up to provide

Modified: cfe/branches/tooling/www/features.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/features.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/features.html (original)
+++ cfe/branches/tooling/www/features.html Fri Jan 20 10:14:22 2012
@@ -2,10 +2,10 @@
           "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
-  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Clang - Features and Goals</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <style type="text/css">
 </style>
 </head>
@@ -71,7 +71,8 @@
 is significantly quicker than gcc and uses less memory  For example, when
 compiling "Carbon.h" on Mac OS/X, we see that clang is 2.5x faster than GCC:</p>
 
-<img class="img_slide" src="feature-compile1.png" width="400" height="300" />
+<img class="img_slide" src="feature-compile1.png" width="400" height="300"
+     alt="Time to parse carbon.h: -fsyntax-only">
 
 <p>Carbon.h is a monster: it transitively includes 558 files, 12.3M of code,
 declares 10000 functions, has 2000 struct definitions, 8000 fields, 20000 enum
@@ -94,7 +95,8 @@
 fit into memory at a time (useful for whole program analysis tools, for
 example).</p>
 
-<img class="img_slide" src="feature-memory1.png" width="400" height="300" />
+<img class="img_slide" src="feature-memory1.png" width="400" height="300"
+     alt="Space">
 
 <p>Here we see a huge advantage of clang: its ASTs take <b>5x less memory</b>
 than GCC's syntax trees, despite the fact that clang's ASTs capture far more 
@@ -107,7 +109,8 @@
 with it.  This means that it is often possible to apply out-of-the-box thinking
 and novel techniques to improve compilation in various ways.</p> 
   
-<img class="img_slide" src="feature-compile2.png" width="400" height="300" />
+<img class="img_slide" src="feature-compile2.png" width="400" height="300"
+     alt="Preprocessor Speeds: GCC 4.2 vs clang-all">
 
 <p>This slide shows how the clang preprocessor can be used to make "distcc"
 parallelization <b>3x</b> more scalable than when using the GCC preprocessor.
@@ -149,8 +152,8 @@
   t.c:7: error: invalid operands to binary + (have 'int' and 'struct A')
   $ <b>clang -fsyntax-only t.c</b>
   t.c:7:39: error: invalid operands to binary expression ('int' and 'struct A')
-  <font color="darkgreen">  return y + func(y ? ((SomeA.X + 40) + SomeA) / 42 + SomeA.X : SomeA.X);</font>
-  <font color="blue">                       ~~~~~~~~~~~~~~ ^ ~~~~~</font>
+  <span style="color:darkgreen">  return y + func(y ? ((SomeA.X + 40) + SomeA) / 42 + SomeA.X : SomeA.X);</span>
+  <span style="color:blue">                       ~~~~~~~~~~~~~~ ^ ~~~~~</span>
 </pre>
 
 <p>Here you can see that you don't even need to see the original source code to
@@ -200,13 +203,13 @@
 and makes it easier for new developers to get involved (because they only need
 to understand small pieces of the big picture).</p>
 
-<blockquote>
+<blockquote><p>
 "The world needs better compiler tools, tools which are built as libraries.
 This design point allows reuse of the tools in new and novel ways. However,
 building the tools as libraries isn't enough: they must have clean APIs, be as
 decoupled from each other as possible, and be easy to modify/extend. This
 requires clean layering, decent design, and keeping the libraries independent of
-any specific client."</blockquote>
+any specific client."</p></blockquote>
 
 <p>
 Currently, clang is divided into the following libraries and tool:
@@ -295,7 +298,7 @@
 when we realize we made a mistake.</p>
 
 <!--=======================================================================-->
-<h3><a name="ideintegration">Integration with IDEs</h3>
+<h3 id="ideintegration">Integration with IDEs</h3>
 <!--=======================================================================-->
 
 <p>

Modified: cfe/branches/tooling/www/get_involved.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/get_involved.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/get_involved.html (original)
+++ cfe/branches/tooling/www/get_involved.html Fri Jan 20 10:14:22 2012
@@ -2,10 +2,10 @@
           "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
-  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Clang - Get Involved</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
 </head>
 <body>
 
@@ -56,7 +56,7 @@
 
 <p>If you're looking for something to work on, check out our <a href="OpenProjects.html">Open Projects</a> page or go look through the <a href="http://llvm.org/bugs/">Bugzilla bug database</a>.</p>
 
-<h2 name="criteria">Contributing Extensions to Clang</h2>
+<h2 id="criteria">Contributing Extensions to Clang</h2>
 
 <p>Clang has always been designed as a platform for experimentation,
 allowing programmers to easily extend the compiler to support great

Modified: cfe/branches/tooling/www/get_started.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/get_started.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/get_started.html (original)
+++ cfe/branches/tooling/www/get_started.html Fri Jan 20 10:14:22 2012
@@ -2,10 +2,10 @@
           "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
-  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Clang - Getting Started</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
 </head>
 <body>
 
@@ -45,23 +45,26 @@
       http://www.python.org/download</a></li>
   </ul>
 
-  <li>Checkout LLVM:</li>
+  <li>Checkout LLVM:
   <ul>
     <li>Change directory to where you want the llvm directory placed.</li>
     <li><tt>svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm</tt></li>
   </ul>
-  <li>Checkout Clang:</li>
+  </li>
+  <li>Checkout Clang:
   <ul>
     <li><tt>cd llvm/tools</tt>
     <li><tt>svn co http://llvm.org/svn/llvm-project/cfe/trunk clang</tt></li>
   </ul>
-  <li>Checkout Compiler-RT:</li>
+  </li>
+  <li>Checkout Compiler-RT:
   <ul>
     <li><tt>cd llvm/projects</tt>
     <li><tt>svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk
         compiler-rt</tt></li>
   </ul>
-  <li>Build LLVM and Clang:</li>
+  </li>
+  <li>Build LLVM and Clang:
   <ul>
     <li><tt>cd ../..</tt>  (back to where you started)</li>
     <li><tt>mkdir build</tt> (for building without polluting the source dir)
@@ -72,15 +75,15 @@
     <li>This builds both LLVM and Clang for debug mode.</li>
     <li>Note: For subsequent Clang development, you can just do make at the
     clang directory level.</li>
+    <li>It is also possible to use CMake instead of the makefiles. With CMake
+    it is also possible to generate project files for several IDEs: Eclipse
+    CDT4, CodeBlocks, Qt-Creator (use the CodeBlocks generator), KDevelop3.</li>
   </ul>
-
-  <p>It is also possible to use CMake instead of the makefiles. With CMake it 
-     is also possible to generate project files for several IDEs: Eclipse CDT4,
-     CodeBlocks, Qt-Creator (use the CodeBlocks generator), KDevelop3.</p>
+  </li>
 
   <li>If you intend to work on Clang C++ support, you may need to tell it how
       to find your C++ standard library headers.  If Clang cannot find your 
-      system libstdc++ headers, please follow these instructions:</li>
+      system libstdc++ headers, please follow these instructions:
   <ul>
     <li>'<tt>gcc -v -x c++ /dev/null -fsyntax-only</tt>' to get the
     path.</li>
@@ -88,7 +91,8 @@
     hard-coded paths" in <tt>clang/lib/Frontend/InitHeaderSearch.cpp</tt> and
     change the lines below to include that path.</li>
   </ul>
-  <li>Try it out (assuming you add llvm/Debug+Asserts/bin to your path):</li>
+  </li>
+  <li>Try it out (assuming you add llvm/Debug+Asserts/bin to your path):
   <ul>
     <li><tt>clang --help</tt></li>
     <li><tt>clang file.c -fsyntax-only</tt> (check for correctness)</li>
@@ -96,6 +100,7 @@
     <li><tt>clang file.c -S -emit-llvm -o - -O3</tt></li>
     <li><tt>clang file.c -S -O3 -o -</tt> (output native machine code)</li>
   </ul>
+  </li>
 </ol>
 
 <p>Note that the C front-end uses LLVM, but does not depend on llvm-gcc. If you
@@ -122,7 +127,7 @@
 Visual Studio:</p>
 
 <ol>
-  <li>Get the required tools:</li>
+  <li>Get the required tools:
   <ul>
     <li><b>Subversion</b>.  Source code control program.  Get it from:
         <a href="http://subversion.tigris.org/getting.html">
@@ -145,17 +150,20 @@
         Get them from <a href="http://getgnuwin32.sourceforge.net/">
         http://getgnuwin32.sourceforge.net/</a>.</li>
   </ul>
+  </li>
 
-  <li>Checkout LLVM:</li>
+  <li>Checkout LLVM:
   <ul>
     <li><tt>svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm</tt></li>
   </ul>
-  <li>Checkout Clang:</li>
+  </li>
+  <li>Checkout Clang:
   <ul>
      <li><tt>cd llvm\tools</tt>
      <li><tt>svn co http://llvm.org/svn/llvm-project/cfe/trunk clang</tt></li>
   </ul>
-  <li>Run cmake to generate the Visual Studio solution and project files:</li>
+  </li>
+  <li>Run cmake to generate the Visual Studio solution and project files:
   <ul>
     <li><tt>cd ..\..</tt>  (back to where you started)</li>
     <li><tt>mkdir build</tt> (for building without polluting the source dir)</li>
@@ -168,16 +176,17 @@
         definition in CMakeLists.txt.</li>
     <li>See the <a href="http://www.llvm.org/docs/CMake.html">LLVM CMake guide</a> for
         more information on other configuration options for cmake.</li>
-</li>
     <li>The above, if successful, will have created an LLVM.sln file in the
        <tt>build</tt> directory.
   </ul>
-  <li>Build Clang:</li>
+  </li>
+  <li>Build Clang:
   <ul>
     <li>Open LLVM.sln in Visual Studio.</li>
     <li>Build the "clang" project for just the compiler driver and front end, or
       the "ALL_BUILD" project to build everything, including tools.</li>
   </ul>
+  </li>
   <li>Try it out (assuming you added llvm/debug/bin to your path).  (See the
     running examples from above.)</li>
   <li>See <a href="hacking.html#testingWindows">
@@ -189,7 +198,7 @@
 to the latest code base, use the <tt>svn update</tt> command in both the
 llvm and llvm\tools\clang directories, as they are separate repositories.</p>
 
-<a name="driver"><h2>Clang Compiler Driver (Drop-in Substitute for GCC)</h2></a>
+<h2 id="driver">Clang Compiler Driver (Drop-in Substitute for GCC)</h2>
 
 <p>The <tt>clang</tt> tool is the compiler driver and front-end, which is
 designed to be a drop-in replacement for the <tt>gcc</tt> command.  Here are
@@ -248,9 +257,9 @@
 
 <pre class="code">
 $ <b>clang -fsyntax-only ~/t.c -pedantic</b>
-/Users/sabre/t.c:2:17: <font color="magenta">warning:</font> extension used
-<font color="darkgreen">typedef float V __attribute__((vector_size(16)));</font>
-<font color="blue">                ^</font>
+/Users/sabre/t.c:2:17: <span style="color:magenta">warning:</span> extension used
+<span style="color:darkgreen">typedef float V __attribute__((vector_size(16)));</span>
+<span style="color:blue">                ^</span>
 1 diagnostic generated.
 </pre>
 

Modified: cfe/branches/tooling/www/hacking.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/hacking.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/hacking.html (original)
+++ cfe/branches/tooling/www/hacking.html Fri Jan 20 10:14:22 2012
@@ -3,10 +3,13 @@
 <!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
 <html>
 <head>
-  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Hacking on clang</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
+  <style type="text/css">
+  pre { margin-left: 1.5em; }
+  </style>
 </head>
 <body>
 <!--#include virtual="menu.html.incl"-->
@@ -22,18 +25,19 @@
       <li><a href="#style">Coding Standards</a></li>
       <li><a href="#docs">Developer Documentation</a></li>
       <li><a href="#debugging">Debugging</a></li>
-      <li><a href="#testing">Testing</a></li>
+      <li><a href="#testing">Testing</a>
       <ul>
         <li><a href="#testingNonWindows">Testing on Unix-like Systems</a></li>
         <li><a href="#testingWindows">Testing using Visual Studio on Windows</a></li>
         <li><a href="#testingCommands">Testing on the Command Line</a></li>
       </ul>
+      </li>
       <li><a href="#patches">Creating Patch Files</a></li>
       <li><a href="#irgen">LLVM IR Generation</a></li>
     </ul>
 
   <!--=====================================================================-->
-  <h2 id="docs">Coding Standards</h2>
+  <h2 id="style">Coding Standards</h2>
   <!--=====================================================================-->
 
   <p>Clang follows the
@@ -139,7 +143,7 @@
   <p>During the run of <tt>make test</tt>, the terminal output will
   display a line similar to the following:</p>
 
-  <ul><tt>--- Running clang tests for i686-pc-linux-gnu ---</tt></ul>
+  <pre>--- Running clang tests for i686-pc-linux-gnu ---</pre>
 
   <p>followed by a line continually overwritten with the current test
   file being compiled, and an overall completion percentage.</p>
@@ -150,12 +154,12 @@
   <tt>Failing Tests (count):</tt> message will be followed by a list
   of the test source file paths that failed.  For example:</p>
 
-  <tt><pre>
+  <pre>
   Failing Tests (3):
       /home/john/llvm/tools/clang/test/SemaCXX/member-name-lookup.cpp
       /home/john/llvm/tools/clang/test/SemaCXX/namespace-alias.cpp
       /home/john/llvm/tools/clang/test/SemaCXX/using-directive.cpp
-  </pre></tt>
+</pre>
 
   <p>If you used the <tt>make VERBOSE=1</tt> option, the terminal
   output will reflect the error messages from the compiler and
@@ -210,10 +214,10 @@
   <p>To run all the tests from the command line, execute a command like
   the following:</p>
 
-  <tt>
+  <pre>
   python (path to llvm)/llvm/utils/lit/lit.py -sv --no-progress-bar
  (path to llvm)/llvm/tools/clang/test
-  </tt>
+</pre>
 
   <p>For CMake builds e.g. on Windows with Visual Studio, you will need
   to specify your build configuration (Debug, Release, etc.) via
@@ -221,31 +225,31 @@
 
   <p>To run a single test:</p>
 
-  <tt>
+  <pre>
   python (path to llvm)/llvm/utils/lit/lit.py -sv --no-progress-bar
  (path to llvm)/llvm/tools/clang/test/(dir)/(test)
-  </tt>
+</pre>
 
   <p>For example:</p>
 
-  <tt>
+  <pre>
   python C:/Tools/llvm/utils/lit/lit.py -sv --no-progress-bar
   C:/Tools/llvm/tools/clang/test/Sema/wchar.c
-  </tt>
+</pre>
 
   <p>The -sv option above tells the runner to show the test output if
   any tests failed, to help you determine the cause of failure.</p>
 
   <p>Your output might look something like this:</p>
 
-<tt><pre>lit.py: lit.cfg:152: note: using clang: 'C:/Tools/llvm/bin/Release\\clang.EXE'
+  <pre>lit.py: lit.cfg:152: note: using clang: 'C:/Tools/llvm/bin/Release\\clang.EXE'
 -- Testing: Testing: 2534 tests, 4 threads --
 Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
 Testing Time: 81.52s
   Expected Passes    : 2503
   Expected Failures  : 28
   Unsupported Tests  : 3
-</pre></tt>
+</pre>
 
   <p>The statistic, "Unexpected Failures" (not shown if all tests pass), is the important one.</p>
 
@@ -263,15 +267,15 @@
   <p>To create these patch files, change directory
   to the llvm/tools/clang root and run:</p>
 
-  <ul><tt>svn diff (relative path) >(patch file name)</tt></ul>
+  <pre>svn diff (relative path) >(patch file name)</pre>
 
   <p>For example, for getting the diffs of all of clang:</p>
 
-  <ul><tt>svn diff . >~/mypatchfile.patch</tt></ul>
+  <pre>svn diff . >~/mypatchfile.patch</pre>
 
   <p>For example, for getting the diffs of a single file:</p>
 
-  <ul><tt>svn diff lib/Parse/ParseDeclCXX.cpp >~/ParseDeclCXX.patch</tt></ul>
+  <pre>svn diff lib/Parse/ParseDeclCXX.cpp >~/ParseDeclCXX.patch</pre>
 
   <p>Note that the paths embedded in the patch depend on where you run it,
   so changing directory to the llvm/tools/clang directory is recommended.</p>

Modified: cfe/branches/tooling/www/performance-2008-10-31.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/performance-2008-10-31.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/performance-2008-10-31.html (original)
+++ cfe/branches/tooling/www/performance-2008-10-31.html Fri Jan 20 10:14:22 2012
@@ -2,10 +2,10 @@
           "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
-  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Clang - Performance</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <style type="text/css">
 </style>
 </head>
@@ -20,7 +20,7 @@
 <!--*************************************************************************-->
 
 <p>This page tracks the compile time performance of Clang on two
-interesting benchmarks:
+interesting benchmarks:</p>
 <ul>
   <li><i>Sketch</i>: The Objective-C example application shipped on
     Mac OS X as part of Xcode. <i>Sketch</i> is indicative of a
@@ -37,7 +37,6 @@
   dependencies. This stresses the back-end's performance on generating
   assembly code and debug information.</li>
 </ul>
-</p>
 
 <!--*************************************************************************-->
 <h2><a name="enduser">Experiments</a></h2>
@@ -46,7 +45,7 @@
 <p>Measurements are done by serially processing each file in the
 respective benchmark, using Clang, gcc, and llvm-gcc as compilers. In
 order to track the performance of various subsystems the timings have
-been broken down into separate stages where possible:
+been broken down into separate stages where possible:</p>
 
 <ul>
   <li><tt>-Eonly</tt>: This option runs the preprocessor but does not
@@ -65,7 +64,6 @@
   <li><tt>-S -O0 -g</tt>: This adds emission of debug information to
     the assembly output.</li>
 </ul>
-</p>
 
 <p>This set of stages is chosen to be approximately additive, that is
 each subsequent stage simply adds some additional processing. The
@@ -94,9 +92,9 @@
 <h3><a name="2008-10-31">2008-10-31</a></h3>
 <!--=======================================================================-->
 
-<center><h4>Sketch</h4></center>
+<h4 style="text-align:center">Sketch</h4>
 <img class="img_slide" 
-     src="timing-data/2008-10-31/sketch.png" alt="Sketch Timings"/>
+     src="timing-data/2008-10-31/sketch.png" alt="Sketch Timings">
 
 <p>This shows Clang's substantial performance improvements in
 preprocessing and semantic analysis; over 90% faster on
@@ -112,9 +110,9 @@
 have an implementation of PCH-style optimizations, but we are actively
 working to address this.</p>
 
-<center><h4>176.gcc</h4></center>
+<h4 style="text-align:center">176.gcc</h4>
 <img class="img_slide" 
-     src="timing-data/2008-10-31/176.gcc.png" alt="176.gcc Timings"/>
+     src="timing-data/2008-10-31/176.gcc.png" alt="176.gcc Timings">
 
 <p>Unlike the <i>Sketch</i> timings, compilation of <i>176.gcc</i>
 involves a large amount of code generation. The time spent in Clang's

Modified: cfe/branches/tooling/www/performance-2009-03-02.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/performance-2009-03-02.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/performance-2009-03-02.html (original)
+++ cfe/branches/tooling/www/performance-2009-03-02.html Fri Jan 20 10:14:22 2012
@@ -2,10 +2,10 @@
           "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
-  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Clang - Performance</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <style type="text/css">
 </style>
 </head>
@@ -20,7 +20,7 @@
 <!--*************************************************************************-->
 
 <p>This page shows the compile time performance of Clang on two
-interesting benchmarks:
+interesting benchmarks:</p>
 <ul>
   <li><i>Sketch</i>: The Objective-C example application shipped on
     Mac OS X as part of Xcode. <i>Sketch</i> is indicative of a
@@ -37,7 +37,6 @@
     dependencies. This stresses the back-end's performance on generating
     assembly code and debug information.</li>
 </ul>
-</p>
 
 <p>
 For previous performance numbers, please
@@ -57,7 +56,7 @@
 have been broken down into separate stages where possible. This is
 done by over-riding the CC environment variable used during the build
 to point to one of a few simple shell scripts which may skip part of
-the build.
+the build.</p>
 
 <ul>
   <li><tt>non-compiler</tt>: The overhead of the build system itself;
@@ -78,7 +77,6 @@
   <li><tt>+ assembler</tt>: Add assembler time to generate .o files.</li>
   <li><tt>+ linker</tt>: Add linker time.</li>
 </ul>
-</p>
 
 <p>This set of stages is chosen to be approximately additive, that is
 each subsequent stage simply adds some additional processing. The
@@ -99,12 +97,12 @@
 
 <a href="timing-data/2009-03-02/sketch.pdf">
 <img class="img_slide" 
-     src="timing-data/2009-03-02/sketch.png" alt="Sketch Timings"/>
+     src="timing-data/2009-03-02/sketch.png" alt="Sketch Timings">
 </a>
 
 <a href="timing-data/2009-03-02/176.gcc.pdf">
 <img class="img_slide" 
-     src="timing-data/2009-03-02/176.gcc.png" alt="176.gcc Timings"/>
+     src="timing-data/2009-03-02/176.gcc.png" alt="176.gcc Timings">
 </a>
 
 </div>

Modified: cfe/branches/tooling/www/performance.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/performance.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/performance.html (original)
+++ cfe/branches/tooling/www/performance.html Fri Jan 20 10:14:22 2012
@@ -2,10 +2,10 @@
           "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
-  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Clang - Performance</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
   <style type="text/css">
 </style>
 </head>
@@ -20,7 +20,7 @@
 <!--*************************************************************************-->
 
 <p>This page shows the compile time performance of Clang on two
-interesting benchmarks:
+interesting benchmarks:</p>
 <ul>
   <li><i>Sketch</i>: The Objective-C example application shipped on
     Mac OS X as part of Xcode. <i>Sketch</i> is indicative of a
@@ -37,7 +37,6 @@
     dependencies. This stresses the back-end's performance on generating
     assembly code and debug information.</li>
 </ul>
-</p>
 
 <p>
 For previous performance numbers, please
@@ -56,7 +55,7 @@
 have been broken down into separate stages where possible. This is
 done by over-riding the CC environment variable used during the build
 to point to one of a few simple shell scripts which may skip part of
-the build.
+the build.</p>
 
 <ul>
   <li><tt>non-compiler</tt>: The overhead of the build system itself;
@@ -73,7 +72,6 @@
   <li><tt>+ assembler</tt>: Add assembler time to generate .o files.</li>
   <li><tt>+ linker</tt>: Add linker time.</li>
 </ul>
-</p>
 
 <p>This set of stages is chosen to be approximately additive, that is each
 subsequent stage simply adds some additional processing. The timings measure the
@@ -93,12 +91,12 @@
 
 <a href="timing-data/2009-06-26/sketch.pdf">
 <img class="img_slide" 
-     src="timing-data/2009-06-26/sketch.png" alt="Sketch Timings"/>
+     src="timing-data/2009-06-26/sketch.png" alt="Sketch Timings">
 </a>
 
 <a href="timing-data/2009-06-26/176.gcc.pdf">
 <img class="img_slide" 
-     src="timing-data/2009-06-26/176.gcc.png" alt="176.gcc Timings"/>
+     src="timing-data/2009-06-26/176.gcc.png" alt="176.gcc Timings">
 </a>
 
 </div>

Modified: cfe/branches/tooling/www/related.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/related.html?rev=148545&r1=148544&r2=148545&view=diff
==============================================================================
--- cfe/branches/tooling/www/related.html (original)
+++ cfe/branches/tooling/www/related.html Fri Jan 20 10:14:22 2012
@@ -3,10 +3,10 @@
 <!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
 <html>
 <head>
-  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Clang Related Projects</title>
-  <link type="text/css" rel="stylesheet" href="menu.css" />
-  <link type="text/css" rel="stylesheet" href="content.css" />
+  <link type="text/css" rel="stylesheet" href="menu.css">
+  <link type="text/css" rel="stylesheet" href="content.css">
 </head>
 <body>
   <!--#include virtual="menu.html.incl"-->





More information about the llvm-branch-commits mailing list