Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -181,6 +181,11 @@ set(CLANG_HAVE_LIBXML 1) endif() +find_package(Z3 4.5 QUIET) +if (Z3_FOUND) + set(CLANG_HAVE_Z3 1) +endif() + include(CheckIncludeFile) check_include_file(sys/resource.h CLANG_HAVE_RLIMITS) Index: cmake/modules/FindZ3.cmake =================================================================== --- /dev/null +++ cmake/modules/FindZ3.cmake @@ -0,0 +1,42 @@ +# use pkg-config to get the directories and then use these values +# in the find_path() and find_library() calls +find_package(PkgConfig QUIET) +PKG_CHECK_MODULES(PC_Z3 QUIET libz3) +set(Z3_DEFINITIONS ${PC_LIBZ3_CFLAGS_OTHER}) + +find_path(Z3_INCLUDE_DIR NAMES z3.h + HINTS + ${PC_LIBZ3_INCLUDEDIR} + ${PC_LIBZ3_INCLUDE_DIRS} + PATH_SUFFIXES libz3 + ) + +find_library(Z3_LIBRARIES NAMES z3 libz3 + HINTS + ${PC_LIBZ3_LIBDIR} + ${PC_LIBZ3_LIBRARY_DIRS} + ) + +find_program(Z3_EXECUTABLE z3) + +if(PC_LIBZ3_VERSION) + set(Z3_VERSION_STRING ${PC_LIBZ3_VERSION}) +elseif(Z3_INCLUDE_DIR AND Z3_EXECUTABLE) + execute_process (COMMAND ${Z3_EXECUTABLE} -version + OUTPUT_VARIABLE libz3_version_str + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + string(REGEX REPLACE "^Z3 version ([0-9.]+)" "\\1" + Z3_VERSION_STRING "${libz3_version_str}") + unset(libz3_version_str) +endif() + +# handle the QUIETLY and REQUIRED arguments and set Z3_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Z3 + REQUIRED_VARS Z3_LIBRARIES Z3_INCLUDE_DIR + VERSION_VAR Z3_VERSION_STRING) + +mark_as_advanced(Z3_INCLUDE_DIR Z3_LIBRARIES) Index: include/clang/Config/config.h.cmake =================================================================== --- include/clang/Config/config.h.cmake +++ include/clang/Config/config.h.cmake @@ -38,6 +38,9 @@ /* Define if we have libxml2 */ #cmakedefine CLANG_HAVE_LIBXML ${CLANG_HAVE_LIBXML} +/* Define if we have z3 */ +#cmakedefine CLANG_HAVE_Z3 ${CLANG_HAVE_Z3} + /* Define if we have sys/resource.h (rlimits) */ #cmakedefine CLANG_HAVE_RLIMITS ${CLANG_HAVE_RLIMITS} Index: include/clang/StaticAnalyzer/Core/Analyses.def =================================================================== --- include/clang/StaticAnalyzer/Core/Analyses.def +++ include/clang/StaticAnalyzer/Core/Analyses.def @@ -22,6 +22,7 @@ #endif ANALYSIS_CONSTRAINTS(RangeConstraints, "range", "Use constraint tracking of concrete value ranges", CreateRangeConstraintManager) +ANALYSIS_CONSTRAINTS(Z3Constraints, "z3", "Use Z3 contraint solver", CreateZ3ConstraintManagerStub) #ifndef ANALYSIS_DIAGNOSTICS #define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATEFN) Index: include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h =================================================================== --- include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h +++ include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h @@ -184,6 +184,9 @@ CreateRangeConstraintManager(ProgramStateManager &statemgr, SubEngine *subengine); +std::unique_ptr +CreateZ3ConstraintManagerStub(ProgramStateManager &statemgr, SubEngine *subengine); + } // end GR namespace } // end clang namespace Index: lib/StaticAnalyzer/Core/CMakeLists.txt =================================================================== --- lib/StaticAnalyzer/Core/CMakeLists.txt +++ lib/StaticAnalyzer/Core/CMakeLists.txt @@ -43,6 +43,7 @@ Store.cpp SubEngine.cpp SymbolManager.cpp + Z3ConstraintManagerStub.cpp LINK_LIBS clangAST Index: lib/StaticAnalyzer/Core/Z3ConstraintManagerStub.cpp =================================================================== --- /dev/null +++ lib/StaticAnalyzer/Core/Z3ConstraintManagerStub.cpp @@ -0,0 +1,32 @@ +//== Z3ConstraintManagerStub.cpp --------------------------------*- C++ -*--==// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "clang/StaticAnalyzer/Core/PathSensitive/SimpleConstraintManager.h" + +#include "llvm/Support/DynamicLibrary.h" +#include "llvm/Support/ErrorHandling.h" + +using namespace clang; +using namespace ento; +using llvm::sys::DynamicLibrary; + +std::unique_ptr +ento::CreateZ3ConstraintManagerStub(ProgramStateManager &StMgr, SubEngine *Eng) { + static ConstraintManagerCreator CMCreator = nullptr; + + // Lookup and cache the result + if (!CMCreator) + CMCreator = (ConstraintManagerCreator) DynamicLibrary::SearchForAddressOfSymbol("CreateZ3ConstraintManager"); + + if (CMCreator) + return CMCreator(StMgr, Eng); + + llvm::report_fatal_error("The Z3 constraint manager plugin was not loaded!"); + return nullptr; +} Index: test/Analysis/CFContainers-invalid.c =================================================================== --- test/Analysis/CFContainers-invalid.c +++ test/Analysis/CFContainers-invalid.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=osx.coreFoundation.containers.PointerSizedValues -triple x86_64-apple-darwin -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=osx.coreFoundation.containers.PointerSizedValues -triple x86_64-apple-darwin -verify %s // expected-no-diagnostics typedef const struct __CFAllocator * CFAllocatorRef; Index: test/Analysis/CFContainers.mm =================================================================== --- test/Analysis/CFContainers.mm +++ test/Analysis/CFContainers.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=osx.coreFoundation.containers.PointerSizedValues,osx.coreFoundation.containers.OutOfBounds -analyzer-store=region -triple x86_64-apple-darwin -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=osx.coreFoundation.containers.PointerSizedValues,osx.coreFoundation.containers.OutOfBounds -analyzer-store=region -triple x86_64-apple-darwin -verify %s typedef const struct __CFAllocator * CFAllocatorRef; typedef const struct __CFString * CFStringRef; Index: test/Analysis/CFDateGC.m =================================================================== --- test/Analysis/CFDateGC.m +++ test/Analysis/CFDateGC.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify -fobjc-gc %s -Wno-implicit-function-declaration +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify -fobjc-gc %s -Wno-implicit-function-declaration //===----------------------------------------------------------------------===// // The following code is reduced using delta-debugging from Index: test/Analysis/CFNumber.c =================================================================== --- test/Analysis/CFNumber.c +++ test/Analysis/CFNumber.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.coreFoundation.CFNumber,osx.cocoa.RetainCount -analyzer-store=region -verify -triple x86_64-apple-darwin9 %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.coreFoundation.CFNumber,osx.cocoa.RetainCount -analyzer-store=region -verify -triple x86_64-apple-darwin9 %s typedef signed long CFIndex; typedef const struct __CFAllocator * CFAllocatorRef; Index: test/Analysis/CFRetainRelease_NSAssertionHandler.m =================================================================== --- test/Analysis/CFRetainRelease_NSAssertionHandler.m +++ test/Analysis/CFRetainRelease_NSAssertionHandler.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -verify %s -analyzer-store=region +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -verify %s -analyzer-store=region // expected-no-diagnostics typedef struct objc_selector *SEL; Index: test/Analysis/CGColorSpace.c =================================================================== --- test/Analysis/CGColorSpace.c +++ test/Analysis/CGColorSpace.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify %s typedef struct CGColorSpace *CGColorSpaceRef; extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void); Index: test/Analysis/CheckNSError.m =================================================================== --- test/Analysis/CheckNSError.m +++ test/Analysis/CheckNSError.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSError,osx.coreFoundation.CFError -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.NSError,osx.coreFoundation.CFError -analyzer-store=region -verify -Wno-objc-root-class %s typedef signed char BOOL; Index: test/Analysis/DeallocMissingRelease.m =================================================================== --- test/Analysis/DeallocMissingRelease.m +++ test/Analysis/DeallocMissingRelease.m @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.Dealloc -fblocks -triple x86_64-apple-ios4.0 -DMACOS=0 -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.Dealloc -fblocks -triple x86_64-apple-macosx10.6.0 -DMACOS=1 -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.Dealloc -fblocks -triple x86_64-apple-darwin10 -fobjc-arc -fobjc-runtime-has-weak -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=osx.cocoa.Dealloc -fblocks -triple x86_64-apple-ios4.0 -DMACOS=0 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=osx.cocoa.Dealloc -fblocks -triple x86_64-apple-macosx10.6.0 -DMACOS=1 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=osx.cocoa.Dealloc -fblocks -triple x86_64-apple-darwin10 -fobjc-arc -fobjc-runtime-has-weak -verify %s #include "Inputs/system-header-simulator-for-objc-dealloc.h" Index: test/Analysis/DeallocUseAfterFreeErrors.m =================================================================== --- test/Analysis/DeallocUseAfterFreeErrors.m +++ test/Analysis/DeallocUseAfterFreeErrors.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.SuperDealloc,debug.ExprInspection -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.SuperDealloc,debug.ExprInspection -analyzer-output=text -verify %s void clang_analyzer_warnIfReached(); Index: test/Analysis/DynamicTypePropagation.m =================================================================== --- test/Analysis/DynamicTypePropagation.m +++ test/Analysis/DynamicTypePropagation.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.ObjCGenerics -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.ObjCGenerics -verify %s #if !__has_feature(objc_generics) # error Compiler does not support Objective-C generics? Index: test/Analysis/Malloc+MismatchedDeallocator+NewDelete.cpp =================================================================== --- test/Analysis/Malloc+MismatchedDeallocator+NewDelete.cpp +++ test/Analysis/Malloc+MismatchedDeallocator+NewDelete.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator,cplusplus.NewDelete -std=c++11 -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -DLEAKS -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator,cplusplus.NewDelete -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -DLEAKS -std=c++11 -verify %s #include "Inputs/system-header-simulator-for-malloc.h" Index: test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp =================================================================== --- test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp +++ test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator -analyzer-store region -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator -analyzer-store region -std=c++11 -verify %s // expected-no-diagnostics typedef __typeof(sizeof(int)) size_t; Index: test/Analysis/Malloc+NewDelete_intersections.cpp =================================================================== --- test/Analysis/Malloc+NewDelete_intersections.cpp +++ test/Analysis/Malloc+NewDelete_intersections.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete -std=c++11 -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -std=c++11 -verify %s typedef __typeof(sizeof(int)) size_t; void *malloc(size_t); Index: test/Analysis/MemRegion.cpp =================================================================== --- test/Analysis/MemRegion.cpp +++ test/Analysis/MemRegion.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=optin.mpi.MPI-Checker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=optin.mpi.MPI-Checker -verify %s #include "MPIMock.h" Index: test/Analysis/MismatchedDeallocator-checker-test.mm =================================================================== --- test/Analysis/MismatchedDeallocator-checker-test.mm +++ test/Analysis/MismatchedDeallocator-checker-test.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.MismatchedDeallocator -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.MismatchedDeallocator -fblocks -verify %s #include "Inputs/system-header-simulator-objc.h" #include "Inputs/system-header-simulator-cxx.h" Index: test/Analysis/MismatchedDeallocator-path-notes.cpp =================================================================== --- test/Analysis/MismatchedDeallocator-path-notes.cpp +++ test/Analysis/MismatchedDeallocator-path-notes.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.MismatchedDeallocator -analyzer-output=text -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.MismatchedDeallocator -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.MismatchedDeallocator -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.MismatchedDeallocator -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s void changePointee(int *p); Index: test/Analysis/MissingDealloc.m =================================================================== --- test/Analysis/MissingDealloc.m +++ test/Analysis/MissingDealloc.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.Dealloc -fblocks -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.Dealloc -fblocks -verify -triple x86_64-apple-darwin10 -fobjc-arc %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=osx.cocoa.Dealloc -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=osx.cocoa.Dealloc -fblocks -verify -triple x86_64-apple-darwin10 -fobjc-arc %s #define NON_ARC !__has_feature(objc_arc) Index: test/Analysis/NSContainers.m =================================================================== --- test/Analysis/NSContainers.m +++ test/Analysis/NSContainers.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-objc-literal-conversion -analyze -analyzer-checker=core,osx.cocoa.NonNilReturnValue,osx.cocoa.NilArg,osx.cocoa.Loops,debug.ExprInspection -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -Wno-objc-literal-conversion -analyze -analyzer-checker=core,osx.cocoa.NonNilReturnValue,osx.cocoa.NilArg,osx.cocoa.Loops,debug.ExprInspection -verify -Wno-objc-root-class %s void clang_analyzer_eval(int); Index: test/Analysis/NSPanel.m =================================================================== --- test/Analysis/NSPanel.m +++ test/Analysis/NSPanel.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s // expected-no-diagnostics // BEGIN delta-debugging reduced header stuff Index: test/Analysis/NSString.m =================================================================== --- test/Analysis/NSString.m +++ test/Analysis/NSString.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s -// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -analyzer-config mode=shallow -verify -Wno-objc-root-class %s -// RUN: %clang_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s -// RUN: %clang_cc1 -DOSATOMIC_USE_INLINED -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -analyzer-config mode=shallow -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -DTEST_64 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -DOSATOMIC_USE_INLINED -triple i386-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s //===----------------------------------------------------------------------===// // The following code is reduced using delta-debugging from Index: test/Analysis/NSWindow.m =================================================================== --- test/Analysis/NSWindow.m +++ test/Analysis/NSWindow.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core,deadcode.DeadStores -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core,deadcode.DeadStores -analyzer-store=region -verify %s // These declarations were reduced using Delta-Debugging from Foundation.h // on Mac OS X. The test cases are below. Index: test/Analysis/NewDelete+MismatchedDeallocator_intersections.cpp =================================================================== --- test/Analysis/NewDelete+MismatchedDeallocator_intersections.cpp +++ test/Analysis/NewDelete+MismatchedDeallocator_intersections.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,unix.MismatchedDeallocator -std=c++11 -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,unix.MismatchedDeallocator -DLEAKS -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,unix.MismatchedDeallocator -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,unix.MismatchedDeallocator -DLEAKS -std=c++11 -verify %s // expected-no-diagnostics typedef __typeof(sizeof(int)) size_t; Index: test/Analysis/NewDelete-checker-test.cpp =================================================================== --- test/Analysis/NewDelete-checker-test.cpp +++ test/Analysis/NewDelete-checker-test.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete -std=c++11 -fblocks -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.NewDeleteLeaks -DLEAKS -std=c++11 -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete -std=c++11 -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,cplusplus.NewDeleteLeaks -DLEAKS -std=c++11 -fblocks -verify %s #include "Inputs/system-header-simulator-cxx.h" typedef __typeof__(sizeof(int)) size_t; Index: test/Analysis/NewDelete-custom.cpp =================================================================== --- test/Analysis/NewDelete-custom.cpp +++ test/Analysis/NewDelete-custom.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,unix.Malloc -std=c++11 -fblocks -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,unix.Malloc -std=c++11 -DLEAKS -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,unix.Malloc -std=c++11 -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,unix.Malloc -std=c++11 -DLEAKS -fblocks -verify %s #include "Inputs/system-header-simulator-cxx.h" #ifndef LEAKS Index: test/Analysis/NewDelete-intersections.mm =================================================================== --- test/Analysis/NewDelete-intersections.mm +++ test/Analysis/NewDelete-intersections.mm @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete -std=c++11 -fblocks -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -std=c++11 -DLEAKS -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete -std=c++11 -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -std=c++11 -DLEAKS -fblocks -verify %s #include "Inputs/system-header-simulator-cxx.h" #include "Inputs/system-header-simulator-objc.h" Index: test/Analysis/NewDelete-path-notes.cpp =================================================================== --- test/Analysis/NewDelete-path-notes.cpp +++ test/Analysis/NewDelete-path-notes.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=text -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=cplusplus.NewDelete,unix.Malloc -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s void test() { Index: test/Analysis/NewDelete-variadic.cpp =================================================================== --- test/Analysis/NewDelete-variadic.cpp +++ test/Analysis/NewDelete-variadic.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,unix.Malloc -std=c++11 -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,unix.Malloc -std=c++11 -fblocks -verify %s // expected-no-diagnostics namespace std { Index: test/Analysis/NewDeleteLeaks-PR18394.cpp =================================================================== --- test/Analysis/NewDeleteLeaks-PR18394.cpp +++ test/Analysis/NewDeleteLeaks-PR18394.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyzer-config graph-trim-interval=1 -analyzer-max-loop 1 -analyze -analyzer-checker=core,cplusplus.NewDeleteLeaks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyzer-config graph-trim-interval=1 -analyzer-max-loop 1 -analyze -analyzer-checker=core,cplusplus.NewDeleteLeaks -verify %s // expected-no-diagnostics class A { Index: test/Analysis/NewDeleteLeaks-PR19102.cpp =================================================================== --- test/Analysis/NewDeleteLeaks-PR19102.cpp +++ test/Analysis/NewDeleteLeaks-PR19102.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.NewDeleteLeaks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,cplusplus.NewDeleteLeaks -verify %s class A0 {}; Index: test/Analysis/NoReturn.m =================================================================== --- test/Analysis/NoReturn.m +++ test/Analysis/NoReturn.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify %s #include Index: test/Analysis/OSAtomic_mac.cpp =================================================================== --- test/Analysis/OSAtomic_mac.cpp +++ test/Analysis/OSAtomic_mac.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,osx -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,osx -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s // expected-no-diagnostics // Test handling of OSAtomicCompareAndSwap when C++ inserts "no-op" casts and we Index: test/Analysis/ObjCProperties.m =================================================================== --- test/Analysis/ObjCProperties.m +++ test/Analysis/ObjCProperties.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-objc-root-class %s -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-objc-root-class %s -verify // expected-no-diagnostics // The point of this test cases is to exercise properties in the static Index: test/Analysis/ObjCPropertiesSyntaxChecks.m =================================================================== --- test/Analysis/ObjCPropertiesSyntaxChecks.m +++ test/Analysis/ObjCPropertiesSyntaxChecks.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -w -fblocks -analyze -analyzer-checker=osx.ObjCProperty %s -verify +// RUN: %clang_cc1 %z3_cc1 -w -fblocks -analyze -analyzer-checker=osx.ObjCProperty %s -verify #include "Inputs/system-header-simulator-objc.h" Index: test/Analysis/ObjCRetSigs.m =================================================================== --- test/Analysis/ObjCRetSigs.m +++ test/Analysis/ObjCRetSigs.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-checker=osx.cocoa.IncompatibleMethodTypes -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-checker=osx.cocoa.IncompatibleMethodTypes -verify -Wno-objc-root-class %s int printf(const char *, ...); Index: test/Analysis/PR12905.c =================================================================== --- test/Analysis/PR12905.c +++ test/Analysis/PR12905.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core %s // PR12905 void C(void); Index: test/Analysis/PR24184.cpp =================================================================== --- test/Analysis/PR24184.cpp +++ test/Analysis/PR24184.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -w -analyze -analyzer-eagerly-assume -fcxx-exceptions -analyzer-checker=core -analyzer-checker=alpha.core.PointerArithm,alpha.core.CastToStruct -analyzer-max-loop 64 -verify %s -// RUN: %clang_cc1 -w -analyze -analyzer-checker=core -analyzer-checker=cplusplus -fcxx-exceptions -analyzer-checker alpha.core.PointerArithm,alpha.core.CastToStruct -analyzer-max-loop 63 -verify %s +// RUN: %clang_cc1 %z3_cc1 -w -analyze -analyzer-eagerly-assume -fcxx-exceptions -analyzer-checker=core -analyzer-checker=alpha.core.PointerArithm,alpha.core.CastToStruct -analyzer-max-loop 64 -verify %s +// RUN: %clang_cc1 %z3_cc1 -w -analyze -analyzer-checker=core -analyzer-checker=cplusplus -fcxx-exceptions -analyzer-checker alpha.core.PointerArithm,alpha.core.CastToStruct -analyzer-max-loop 63 -verify %s // These tests used to hit an assertion in the bug report. Test case from http://llvm.org/PR24184. typedef struct { Index: test/Analysis/PR2599.m =================================================================== --- test/Analysis/PR2599.m +++ test/Analysis/PR2599.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple %itanium_abi_triple -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -fobjc-gc -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple %itanium_abi_triple -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -fobjc-gc -verify %s typedef const void * CFTypeRef; typedef const struct __CFString * CFStringRef; Index: test/Analysis/PR2978.m =================================================================== --- test/Analysis/PR2978.m +++ test/Analysis/PR2978.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,osx.cocoa.Dealloc %s -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core,osx.cocoa.Dealloc %s -verify // Tests for the checker which checks missing/extra ivar 'release' calls // in dealloc. Index: test/Analysis/PR3991.m =================================================================== --- test/Analysis/PR3991.m +++ test/Analysis/PR3991.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -triple x86_64-apple-darwin9 -Wno-incomplete-implementation %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -triple x86_64-apple-darwin9 -Wno-incomplete-implementation %s // expected-no-diagnostics //===----------------------------------------------------------------------===// Index: test/Analysis/PR7218.c =================================================================== --- test/Analysis/PR7218.c +++ test/Analysis/PR7218.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store region -verify %s char PR7218(char a) { char buf[2]; buf[0] = a; Index: test/Analysis/PR9741.cpp =================================================================== --- test/Analysis/PR9741.cpp +++ test/Analysis/PR9741.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -Wuninitialized -verify %s +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -Wuninitialized -verify %s // expected-no-diagnostics void f() { Index: test/Analysis/additive-folding-range-constraints.c =================================================================== --- test/Analysis/additive-folding-range-constraints.c +++ test/Analysis/additive-folding-range-constraints.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s void clang_analyzer_eval(int); Index: test/Analysis/additive-folding.cpp =================================================================== --- test/Analysis/additive-folding.cpp +++ test/Analysis/additive-folding.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify -Wno-tautological-compare %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify -Wno-tautological-compare %s void clang_analyzer_eval(bool); Index: test/Analysis/analyzeOneFunction.m =================================================================== --- test/Analysis/analyzeOneFunction.m +++ test/Analysis/analyzeOneFunction.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyze-function="-[Test1 myMethodWithY:withX:]" -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyze-function="-[Test1 myMethodWithY:withX:]" -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify %s typedef signed char BOOL; typedef unsigned int NSUInteger; Index: test/Analysis/analyzer-checker-config.c =================================================================== --- test/Analysis/analyzer-checker-config.c +++ test/Analysis/analyzer-checker-config.c @@ -1,10 +1,10 @@ -// RUN: not %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config unix.mallo:Optimistic=true 2>&1 | FileCheck %s -// RUN: not %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config uni:Optimistic=true 2>&1 | FileCheck %s -// RUN: not %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config uni.:Optimistic=true 2>&1 | FileCheck %s -// RUN: not %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config ..:Optimistic=true 2>&1 | FileCheck %s -// RUN: not %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config unix.:Optimistic=true 2>&1 | FileCheck %s -// RUN: not %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config unrelated:Optimistic=true 2>&1 | FileCheck %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config unix.Malloc:Optimistic=true +// RUN: not %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config unix.mallo:Optimistic=true 2>&1 | FileCheck %s +// RUN: not %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config uni:Optimistic=true 2>&1 | FileCheck %s +// RUN: not %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config uni.:Optimistic=true 2>&1 | FileCheck %s +// RUN: not %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config ..:Optimistic=true 2>&1 | FileCheck %s +// RUN: not %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config unix.:Optimistic=true 2>&1 | FileCheck %s +// RUN: not %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config unrelated:Optimistic=true 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-config unix.Malloc:Optimistic=true // Just to test clang is working. # foo Index: test/Analysis/analyzer-config.c =================================================================== --- test/Analysis/analyzer-config.c +++ test/Analysis/analyzer-config.c @@ -1,4 +1,4 @@ -// RUN: %clang -target x86_64-apple-darwin10 --analyze %s -o /dev/null -Xclang -analyzer-checker=debug.ConfigDumper -Xclang -analyzer-max-loop -Xclang 34 > %t 2>&1 +// RUN: %clang %z3 -target x86_64-apple-darwin10 --analyze %s -o /dev/null -Xclang -analyzer-checker=debug.ConfigDumper -Xclang -analyzer-max-loop -Xclang 34 > %t 2>&1 // RUN: FileCheck --input-file=%t %s void bar() {} Index: test/Analysis/analyzer-config.cpp =================================================================== --- test/Analysis/analyzer-config.cpp +++ test/Analysis/analyzer-config.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -target x86_64-apple-darwin10 --analyze %s -o /dev/null -Xclang -analyzer-checker=debug.ConfigDumper -Xclang -analyzer-max-loop -Xclang 34 > %t 2>&1 +// RUN: %clang %z3 -target x86_64-apple-darwin10 --analyze %s -o /dev/null -Xclang -analyzer-checker=debug.ConfigDumper -Xclang -analyzer-max-loop -Xclang 34 > %t 2>&1 // RUN: FileCheck --input-file=%t %s void bar() {} Index: test/Analysis/analyzer-display-progress.cpp =================================================================== --- test/Analysis/analyzer-display-progress.cpp +++ test/Analysis/analyzer-display-progress.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-display-progress %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-display-progress %s 2>&1 | FileCheck %s void f() {}; void g() {}; Index: test/Analysis/analyzer-display-progress.m =================================================================== --- test/Analysis/analyzer-display-progress.m +++ test/Analysis/analyzer-display-progress.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fblocks -analyze -analyzer-display-progress %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -fblocks -analyze -analyzer-display-progress %s 2>&1 | FileCheck %s #include "Inputs/system-header-simulator-objc.h" Index: test/Analysis/analyzer-enabled-checkers.c =================================================================== --- test/Analysis/analyzer-enabled-checkers.c +++ test/Analysis/analyzer-enabled-checkers.c @@ -1,4 +1,4 @@ -// RUN: %clang -target x86_64-apple-darwin10 --analyze %s -o /dev/null -Xclang -analyzer-checker=core -Xclang -analyzer-list-enabled-checkers > %t 2>&1 +// RUN: %clang %z3 -target x86_64-apple-darwin10 --analyze %s -o /dev/null -Xclang -analyzer-checker=core -Xclang -analyzer-list-enabled-checkers > %t 2>&1 // RUN: FileCheck --input-file=%t %s // CHECK: OVERVIEW: Clang Static Analyzer Enabled Checkers List Index: test/Analysis/analyzer-stats.c =================================================================== --- test/Analysis/analyzer-stats.c +++ test/Analysis/analyzer-stats.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.DeadStores,debug.Stats -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,deadcode.DeadStores,debug.Stats -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s int foo(); Index: test/Analysis/array-struct-region.c =================================================================== --- test/Analysis/array-struct-region.c +++ test/Analysis/array-struct-region.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -verify %s void clang_analyzer_eval(int); Index: test/Analysis/array-struct-region.cpp =================================================================== --- test/Analysis/array-struct-region.cpp +++ test/Analysis/array-struct-region.cpp @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -x c %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -x c++ -analyzer-config c++-inlining=constructors %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -DINLINE -verify -x c %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -DINLINE -verify -x c++ -analyzer-config c++-inlining=constructors %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -x c %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -x c++ -analyzer-config c++-inlining=constructors %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -DINLINE -verify -x c %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -DINLINE -verify -x c++ -analyzer-config c++-inlining=constructors %s void clang_analyzer_eval(int); Index: test/Analysis/array-struct.c =================================================================== --- test/Analysis/array-struct.c +++ test/Analysis/array-struct.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core.CastToStruct -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core.CastToStruct -analyzer-store=region -verify %s struct s { int data; Index: test/Analysis/atomics.c =================================================================== --- test/Analysis/atomics.c +++ test/Analysis/atomics.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s // Tests for c11 atomics. Many of these tests currently yield unknown // because we don't fully model the atomics and instead imprecisely Index: test/Analysis/auto-obj-dtors-cfg-output.cpp =================================================================== --- test/Analysis/auto-obj-dtors-cfg-output.cpp +++ test/Analysis/auto-obj-dtors-cfg-output.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-checker=debug.DumpCFG %s > %t 2>&1 +// RUN: %clang_cc1 %z3_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-checker=debug.DumpCFG %s > %t 2>&1 // RUN: FileCheck --input-file=%t %s class A { Index: test/Analysis/base-init.cpp =================================================================== --- test/Analysis/base-init.cpp +++ test/Analysis/base-init.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-inlining=constructors -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-inlining=constructors -verify %s void clang_analyzer_eval(bool); Index: test/Analysis/bitwise-ops.c =================================================================== --- test/Analysis/bitwise-ops.c +++ test/Analysis/bitwise-ops.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -triple x86_64-apple-darwin13 -Wno-shift-count-overflow -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -triple x86_64-apple-darwin13 -Wno-shift-count-overflow -verify %s void clang_analyzer_eval(int); #define CHECK(expr) if (!(expr)) return; clang_analyzer_eval(expr) Index: test/Analysis/block-in-critical-section.cpp =================================================================== --- test/Analysis/block-in-critical-section.cpp +++ test/Analysis/block-in-critical-section.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.unix.BlockInCriticalSection -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.unix.BlockInCriticalSection -std=c++11 -verify %s void sleep(int x) {} Index: test/Analysis/blocks-no-inline.c =================================================================== --- test/Analysis/blocks-no-inline.c +++ test/Analysis/blocks-no-inline.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=none -fblocks -verify %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=none -fblocks -verify -x c++ %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=none -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=none -fblocks -verify -x c++ %s void clang_analyzer_eval(int); Index: test/Analysis/blocks.m =================================================================== --- test/Analysis/blocks.m +++ test/Analysis/blocks.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -analyzer-opt-analyze-nested-blocks -verify %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -analyzer-opt-analyze-nested-blocks -verify -x objective-c++ %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -analyzer-opt-analyze-nested-blocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -analyzer-opt-analyze-nested-blocks -verify -x objective-c++ %s //===----------------------------------------------------------------------===// // The following code is reduced using delta-debugging from Mac OS X headers: Index: test/Analysis/blocks.mm =================================================================== --- test/Analysis/blocks.mm +++ test/Analysis/blocks.mm @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -fblocks -analyzer-opt-analyze-nested-blocks -verify -x objective-c++ %s -// RUN: %clang_cc1 -std=c++11 -fsyntax-only -analyze -analyzer-checker=core,debug.DumpCFG -fblocks -analyzer-opt-analyze-nested-blocks %s > %t 2>&1 +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -fblocks -analyzer-opt-analyze-nested-blocks -verify -x objective-c++ %s +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -fsyntax-only -analyze -analyzer-checker=core,debug.DumpCFG -fblocks -analyzer-opt-analyze-nested-blocks %s > %t 2>&1 // RUN: FileCheck --input-file=%t %s // expected-no-diagnostics Index: test/Analysis/bool-assignment.c =================================================================== --- test/Analysis/bool-assignment.c +++ test/Analysis/bool-assignment.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core.BoolAssignment -analyzer-store=region -verify -std=c99 -Dbool=_Bool %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core.BoolAssignment -analyzer-store=region -verify -x c++ %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core.BoolAssignment -analyzer-store=region -verify -std=c99 -Dbool=_Bool %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core.BoolAssignment -analyzer-store=region -verify -x c++ %s // Test C++'s bool and C's _Bool. // FIXME: We stopped warning on these when SValBuilder got smarter about Index: test/Analysis/bstring.c =================================================================== --- test/Analysis/bstring.c +++ test/Analysis/bstring.c @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s -// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s -// RUN: %clang_cc1 -analyze -DVARIANT -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s -// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -DVARIANT -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s //===----------------------------------------------------------------------=== // Declarations Index: test/Analysis/bstring.cpp =================================================================== --- test/Analysis/bstring.cpp +++ test/Analysis/bstring.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s #include "Inputs/system-header-simulator-cxx.h" #include "Inputs/system-header-simulator-for-malloc.h" Index: test/Analysis/bug_hash_test.cpp =================================================================== --- test/Analysis/bug_hash_test.cpp +++ test/Analysis/bug_hash_test.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -analyze -analyzer-checker=core,debug.DumpBugHash -analyzer-output=plist %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -analyze -analyzer-checker=core,debug.DumpBugHash -analyzer-output=plist %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s int function(int p) { Index: test/Analysis/bug_hash_test.m =================================================================== --- test/Analysis/bug_hash_test.m +++ test/Analysis/bug_hash_test.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fblocks -analyze -analyzer-checker=core,debug.DumpBugHash -analyzer-output=plist %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -fblocks -analyze -analyzer-checker=core,debug.DumpBugHash -analyzer-output=plist %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s @protocol NSObject Index: test/Analysis/builtin-functions.cpp =================================================================== --- test/Analysis/builtin-functions.cpp +++ test/Analysis/builtin-functions.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection %s -std=c++11 -verify +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection %s -std=c++11 -verify void clang_analyzer_eval(bool); Index: test/Analysis/builtin_signbit.cpp =================================================================== --- test/Analysis/builtin_signbit.cpp +++ test/Analysis/builtin_signbit.cpp @@ -1,6 +1,6 @@ -// RUN: %clang -target powerpc-linux-gnu -emit-llvm -S -O0 %s -o - | FileCheck %s --check-prefix=CHECK-BE --check-prefix=CHECK -// RUN: %clang -target powerpc64-linux-gnu -emit-llvm -S -O0 %s -o - | FileCheck %s --check-prefix=CHECK-BE --check-prefix=CHECK -// RUN: %clang -target powerpc64le-linux-gnu -emit-llvm -S -O0 %s -o - | FileCheck %s --check-prefix=CHECK-LE --check-prefix=CHECK +// RUN: %clang %z3 -target powerpc-linux-gnu -emit-llvm -S -O0 %s -o - | FileCheck %s --check-prefix=CHECK-BE --check-prefix=CHECK +// RUN: %clang %z3 -target powerpc64-linux-gnu -emit-llvm -S -O0 %s -o - | FileCheck %s --check-prefix=CHECK-BE --check-prefix=CHECK +// RUN: %clang %z3 -target powerpc64le-linux-gnu -emit-llvm -S -O0 %s -o - | FileCheck %s --check-prefix=CHECK-LE --check-prefix=CHECK bool b; double d = -1.0; Index: test/Analysis/call-invalidation.cpp =================================================================== --- test/Analysis/call-invalidation.cpp +++ test/Analysis/call-invalidation.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s void clang_analyzer_eval(bool); Index: test/Analysis/cast-to-struct.cpp =================================================================== --- test/Analysis/cast-to-struct.cpp +++ test/Analysis/cast-to-struct.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.core.CastToStruct,core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.core.CastToStruct,core -verify %s struct AB { int A; Index: test/Analysis/castexpr-callback.c =================================================================== --- test/Analysis/castexpr-callback.c +++ test/Analysis/castexpr-callback.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=debug.AnalysisOrder -analyzer-config debug.AnalysisOrder:PreStmtCastExpr=true,debug.AnalysisOrder:PostStmtCastExpr=true %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.AnalysisOrder -analyzer-config debug.AnalysisOrder:PreStmtCastExpr=true,debug.AnalysisOrder:PostStmtCastExpr=true %s 2>&1 | FileCheck %s void test(char c) { int i = (int)c; Index: test/Analysis/casts.c =================================================================== --- test/Analysis/casts.c +++ test/Analysis/casts.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify %s -// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify %s extern void clang_analyzer_eval(_Bool); Index: test/Analysis/casts.cpp =================================================================== --- test/Analysis/casts.cpp +++ test/Analysis/casts.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s bool PR14634(int x) { double y = (double)x; Index: test/Analysis/casts.m =================================================================== --- test/Analysis/casts.m +++ test/Analysis/casts.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s // expected-no-diagnostics // Test function pointer casts. Index: test/Analysis/cfg.cpp =================================================================== --- test/Analysis/cfg.cpp +++ test/Analysis/cfg.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -analyzer-config cfg-temporary-dtors=true -std=c++11 %s > %t 2>&1 +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -analyzer-config cfg-temporary-dtors=true -std=c++11 %s > %t 2>&1 // RUN: FileCheck --input-file=%t %s // CHECK-LABEL: void checkWrap(int i) Index: test/Analysis/cfref_PR2519.c =================================================================== --- test/Analysis/cfref_PR2519.c +++ test/Analysis/cfref_PR2519.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify %s // expected-no-diagnostics typedef unsigned char Boolean; Index: test/Analysis/cfref_rdar6080742.c =================================================================== --- test/Analysis/cfref_rdar6080742.c +++ test/Analysis/cfref_rdar6080742.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s // expected-no-diagnostics // This test case was reported in . Index: test/Analysis/check-deserialization.cpp =================================================================== --- test/Analysis/check-deserialization.cpp +++ test/Analysis/check-deserialization.cpp @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -emit-pch -o %t %s -// RUN: %clang_cc1 -error-on-deserialized-decl S1_method -include-pch %t -analyze -analyzer-checker=core %s -// RUN: %clang_cc1 -include-pch %t -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -emit-pch -o %t %s +// RUN: %clang_cc1 %z3_cc1 -error-on-deserialized-decl S1_method -include-pch %t -analyze -analyzer-checker=core %s +// RUN: %clang_cc1 %z3_cc1 -include-pch %t -analyze -analyzer-checker=core -verify %s #ifndef HEADER #define HEADER Index: test/Analysis/checker-plugins.c =================================================================== --- test/Analysis/checker-plugins.c +++ test/Analysis/checker-plugins.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -load %llvmshlibdir/SampleAnalyzerPlugin%pluginext -analyze -analyzer-checker='example.MainCallChecker' -verify %s +// RUN: %clang_cc1 %z3_cc1 -load %llvmshlibdir/SampleAnalyzerPlugin%pluginext -analyze -analyzer-checker='example.MainCallChecker' -verify %s // REQUIRES: plugins, examples // Test that the MainCallChecker example analyzer plugin loads and runs. Index: test/Analysis/chroot.c =================================================================== --- test/Analysis/chroot.c +++ test/Analysis/chroot.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.unix.Chroot -analyzer-store region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.unix.Chroot -analyzer-store region -verify %s extern int chroot(const char* path); extern int chdir(const char* path); Index: test/Analysis/comparison-implicit-casts.cpp =================================================================== --- test/Analysis/comparison-implicit-casts.cpp +++ test/Analysis/comparison-implicit-casts.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.cstring,debug.ExprInspection -triple i386-apple-darwin9 -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.cstring,debug.ExprInspection -triple x86_64-apple-darwin9 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.cstring,debug.ExprInspection -triple i386-apple-darwin9 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.cstring,debug.ExprInspection -triple x86_64-apple-darwin9 -verify %s // This file runs in C++ mode so that the comparison type is 'bool', not 'int'. void clang_analyzer_eval(int); Index: test/Analysis/complex-init-list.cpp =================================================================== --- test/Analysis/complex-init-list.cpp +++ test/Analysis/complex-init-list.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s // expected-no-diagnostics // Do not crash on initialization to complex numbers. Index: test/Analysis/complex.c =================================================================== --- test/Analysis/complex.c +++ test/Analysis/complex.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify -Wno-unreachable-code -ffreestanding %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify -Wno-unreachable-code -ffreestanding %s #include Index: test/Analysis/concrete-address.c =================================================================== --- test/Analysis/concrete-address.c +++ test/Analysis/concrete-address.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s // expected-no-diagnostics void foo() { Index: test/Analysis/conditional-operator.cpp =================================================================== --- test/Analysis/conditional-operator.cpp +++ test/Analysis/conditional-operator.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection %s -analyzer-output=text -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection %s -analyzer-output=text -verify void clang_analyzer_eval(bool); Index: test/Analysis/conditional-path-notes.c =================================================================== --- test/Analysis/conditional-path-notes.c +++ test/Analysis/conditional-path-notes.c @@ -1,5 +1,5 @@ -// RUN: %clang --analyze %s -Xanalyzer -analyzer-output=text -Xclang -verify -// RUN: %clang --analyze %s -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -o %t +// RUN: %clang %z3 --analyze %s -Xanalyzer -analyzer-output=text -Xclang -verify +// RUN: %clang %z3 --analyze %s -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -o %t // RUN: FileCheck --input-file=%t %s void testCondOp(int *p) { Index: test/Analysis/const-method-call.cpp =================================================================== --- test/Analysis/const-method-call.cpp +++ test/Analysis/const-method-call.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s void clang_analyzer_eval(bool); Index: test/Analysis/constant-folding.c =================================================================== --- test/Analysis/constant-folding.c +++ test/Analysis/constant-folding.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s void clang_analyzer_eval(int); Index: test/Analysis/conversion.c =================================================================== --- test/Analysis/conversion.c +++ test/Analysis/conversion.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-conversion -analyze -analyzer-checker=core,alpha.core.Conversion -verify %s +// RUN: %clang_cc1 %z3_cc1 -Wno-conversion -analyze -analyzer-checker=core,alpha.core.Conversion -verify %s unsigned char U8; signed char S8; Index: test/Analysis/copypaste/asm.cpp =================================================================== --- test/Analysis/copypaste/asm.cpp +++ test/Analysis/copypaste/asm.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-linux -analyze -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-unknown-linux -analyze -analyzer-checker=alpha.clone.CloneChecker -verify %s // expected-no-diagnostics Index: test/Analysis/copypaste/attributes.cpp =================================================================== --- test/Analysis/copypaste/attributes.cpp +++ test/Analysis/copypaste/attributes.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s // expected-no-diagnostics Index: test/Analysis/copypaste/blocks.cpp =================================================================== --- test/Analysis/copypaste/blocks.cpp +++ test/Analysis/copypaste/blocks.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -fblocks -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -fblocks -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s // This tests if we search for clones in blocks. Index: test/Analysis/copypaste/call.cpp =================================================================== --- test/Analysis/copypaste/call.cpp +++ test/Analysis/copypaste/call.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s // expected-no-diagnostics Index: test/Analysis/copypaste/catch.cpp =================================================================== --- test/Analysis/copypaste/catch.cpp +++ test/Analysis/copypaste/catch.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -fcxx-exceptions -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -fcxx-exceptions -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s // expected-no-diagnostics Index: test/Analysis/copypaste/delete.cpp =================================================================== --- test/Analysis/copypaste/delete.cpp +++ test/Analysis/copypaste/delete.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s // expected-no-diagnostics Index: test/Analysis/copypaste/dependent-exist.cpp =================================================================== --- test/Analysis/copypaste/dependent-exist.cpp +++ test/Analysis/copypaste/dependent-exist.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -fms-extensions -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -fms-extensions -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s // expected-no-diagnostics Index: test/Analysis/copypaste/expr-types.cpp =================================================================== --- test/Analysis/copypaste/expr-types.cpp +++ test/Analysis/copypaste/expr-types.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s // expected-no-diagnostics Index: test/Analysis/copypaste/fold.cpp =================================================================== --- test/Analysis/copypaste/fold.cpp +++ test/Analysis/copypaste/fold.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s // expected-no-diagnostics Index: test/Analysis/copypaste/function-try-block.cpp =================================================================== --- test/Analysis/copypaste/function-try-block.cpp +++ test/Analysis/copypaste/function-try-block.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -fcxx-exceptions -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -fcxx-exceptions -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s // Tests if function try blocks are correctly handled. Index: test/Analysis/copypaste/functions.cpp =================================================================== --- test/Analysis/copypaste/functions.cpp +++ test/Analysis/copypaste/functions.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s // This tests if we search for clones in functions. Index: test/Analysis/copypaste/generic.c =================================================================== --- test/Analysis/copypaste/generic.c +++ test/Analysis/copypaste/generic.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c11 -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c11 -analyzer-checker=alpha.clone.CloneChecker -verify %s // expected-no-diagnostics Index: test/Analysis/copypaste/labels.cpp =================================================================== --- test/Analysis/copypaste/labels.cpp +++ test/Analysis/copypaste/labels.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=gnu++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=gnu++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s // expected-no-diagnostics Index: test/Analysis/copypaste/lambda.cpp =================================================================== --- test/Analysis/copypaste/lambda.cpp +++ test/Analysis/copypaste/lambda.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s // expected-no-diagnostics Index: test/Analysis/copypaste/macro-complexity.cpp =================================================================== --- test/Analysis/copypaste/macro-complexity.cpp +++ test/Analysis/copypaste/macro-complexity.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s // Tests that the complexity value of a macro expansion is about the same as // the complexity value of a normal function call and the the macro body doesn't Index: test/Analysis/copypaste/macros.cpp =================================================================== --- test/Analysis/copypaste/macros.cpp +++ test/Analysis/copypaste/macros.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s // Tests that macros and non-macro clones aren't mixed into the same hash // group. This is currently necessary as all clones in a hash group need Index: test/Analysis/copypaste/objc-methods.m =================================================================== --- test/Analysis/copypaste/objc-methods.m +++ test/Analysis/copypaste/objc-methods.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -Wno-objc-root-class -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -Wno-objc-root-class -analyzer-checker=alpha.clone.CloneChecker -verify %s // This tests if we search for clones in Objective-C methods. Index: test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp =================================================================== --- test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp +++ test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-output=plist -analyzer-config notes-as-events=true -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-output=plist -analyzer-config notes-as-events=true -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s // RUN: FileCheck --input-file=%t.plist %s void log(); Index: test/Analysis/copypaste/plist-diagnostics.cpp =================================================================== --- test/Analysis/copypaste/plist-diagnostics.cpp +++ test/Analysis/copypaste/plist-diagnostics.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-output=plist -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-output=plist -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s // RUN: FileCheck --input-file=%t.plist %s void log(); Index: test/Analysis/copypaste/sub-sequences.cpp =================================================================== --- test/Analysis/copypaste/sub-sequences.cpp +++ test/Analysis/copypaste/sub-sequences.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s // This tests if sub-sequences can match with normal sequences. Index: test/Analysis/copypaste/suspicious-clones.cpp =================================================================== --- test/Analysis/copypaste/suspicious-clones.cpp +++ test/Analysis/copypaste/suspicious-clones.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:ReportSuspiciousClones=true -analyzer-config alpha.clone.CloneChecker:ReportNormalClones=false -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:ReportSuspiciousClones=true -analyzer-config alpha.clone.CloneChecker:ReportNormalClones=false -verify %s // Tests finding a suspicious clone that references local variables. Index: test/Analysis/copypaste/text-diagnostics.cpp =================================================================== --- test/Analysis/copypaste/text-diagnostics.cpp +++ test/Analysis/copypaste/text-diagnostics.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-output=text -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-output=text -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s void log(); Index: test/Analysis/coverage.c =================================================================== --- test/Analysis/coverage.c +++ test/Analysis/coverage.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -analyzer-max-loop 4 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -analyzer-max-loop 4 -verify %s #include "Inputs/system-header-simulator.h" typedef __typeof(sizeof(int)) size_t; Index: test/Analysis/crash-trace.c =================================================================== --- test/Analysis/crash-trace.c +++ test/Analysis/crash-trace.c @@ -1,4 +1,4 @@ -// RUN: not --crash %clang_cc1 -analyze -analyzer-checker=debug.ExprInspection %s 2>&1 | FileCheck %s +// RUN: not --crash %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.ExprInspection %s 2>&1 | FileCheck %s // REQUIRES: crash-recovery // FIXME: CHECKs might be incompatible to win32. Index: test/Analysis/cstring-syntax-cxx.cpp =================================================================== --- test/Analysis/cstring-syntax-cxx.cpp +++ test/Analysis/cstring-syntax-cxx.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -verify %s // expected-no-diagnostics // Ensure we don't crash on C++ declarations with special names. Index: test/Analysis/cstring-syntax.c =================================================================== --- test/Analysis/cstring-syntax.c +++ test/Analysis/cstring-syntax.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -Wno-strncat-size -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument -Wno-sizeof-pointer-memaccess -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -Wno-strncat-size -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument -Wno-sizeof-pointer-memaccess -verify %s typedef __SIZE_TYPE__ size_t; char *strncat(char *, const char *, size_t); Index: test/Analysis/ctor.mm =================================================================== --- test/Analysis/ctor.mm +++ test/Analysis/ctor.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -fobjc-arc -analyzer-config c++-inlining=constructors -Wno-null-dereference -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -fobjc-arc -analyzer-config c++-inlining=constructors -Wno-null-dereference -std=c++11 -verify %s #include "Inputs/system-header-simulator-cxx.h" Index: test/Analysis/cxx-crashes.cpp =================================================================== --- test/Analysis/cxx-crashes.cpp +++ test/Analysis/cxx-crashes.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -verify %s // REQUIRES: LP64 void clang_analyzer_eval(bool); Index: test/Analysis/cxx-for-range-cfg.cpp =================================================================== --- test/Analysis/cxx-for-range-cfg.cpp +++ test/Analysis/cxx-for-range-cfg.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wall -fsyntax-only %s -std=c++11 -verify +// RUN: %clang_cc1 %z3_cc1 -Wall -fsyntax-only %s -std=c++11 -verify // The rdar11671507_vector[]> would previously crash CFG construction // because of the temporary array of vectors. Index: test/Analysis/cxx-for-range.cpp =================================================================== --- test/Analysis/cxx-for-range.cpp +++ test/Analysis/cxx-for-range.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=core -analyzer-config path-diagnostics-alternate=true -analyzer-output=plist-multi-file -o %t.plist -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++11 -analyzer-checker=core -analyzer-config path-diagnostics-alternate=true -analyzer-output=plist-multi-file -o %t.plist -verify %s // RUN: FileCheck --input-file=%t.plist %s extern void work(); Index: test/Analysis/cxx-method-names.cpp =================================================================== --- test/Analysis/cxx-method-names.cpp +++ test/Analysis/cxx-method-names.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix,osx,alpha.unix,alpha.security.taint -analyzer-store region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix,osx,alpha.unix,alpha.security.taint -analyzer-store region -verify %s // expected-no-diagnostics class Evil { Index: test/Analysis/cxx11-crashes.cpp =================================================================== --- test/Analysis/cxx11-crashes.cpp +++ test/Analysis/cxx11-crashes.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -std=c++11 -verify %s // radar://11485149, PR12871 class PlotPoint { Index: test/Analysis/dead-stores.c =================================================================== --- test/Analysis/dead-stores.c +++ test/Analysis/dead-stores.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s -// RUN: %clang_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores -analyzer-store=region -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s +// RUN: %clang_cc1 %z3_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s +// RUN: %clang_cc1 %z3_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores -analyzer-store=region -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'}} Index: test/Analysis/dead-stores.cpp =================================================================== --- test/Analysis/dead-stores.cpp +++ test/Analysis/dead-stores.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fblocks -std=c++11 -analyze -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s -// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fblocks -std=c++11 -analyze -analyzer-store=region -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s +// RUN: %clang_cc1 %z3_cc1 -fcxx-exceptions -fexceptions -fblocks -std=c++11 -analyze -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s +// RUN: %clang_cc1 %z3_cc1 -fcxx-exceptions -fexceptions -fblocks -std=c++11 -analyze -analyzer-store=region -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s //===----------------------------------------------------------------------===// // Basic dead store checking (but in C++ mode). Index: test/Analysis/dead-stores.m =================================================================== --- test/Analysis/dead-stores.m +++ test/Analysis/dead-stores.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-checker=deadcode.DeadStores,osx.cocoa.RetainCount -fblocks -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-checker=deadcode.DeadStores,osx.cocoa.RetainCount -fblocks -verify -Wno-objc-root-class %s // expected-no-diagnostics typedef signed char BOOL; Index: test/Analysis/debug-CallGraph.c =================================================================== --- test/Analysis/debug-CallGraph.c +++ test/Analysis/debug-CallGraph.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCallGraph %s -fblocks 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.DumpCallGraph %s -fblocks 2>&1 | FileCheck %s static void mmm(int y) { if (y != 0) Index: test/Analysis/default-analyze.m =================================================================== --- test/Analysis/default-analyze.m +++ test/Analysis/default-analyze.m @@ -1,4 +1,4 @@ -// RUN: %clang --analyze %s -o %t +// RUN: %clang %z3 --analyze %s -o %t // Tests that some specific checkers are enabled by default. Index: test/Analysis/default-diagnostic-visitors.c =================================================================== --- test/Analysis/default-diagnostic-visitors.c +++ test/Analysis/default-diagnostic-visitors.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-output=text -verify %s // This file is for testing enhanced diagnostics produced by the default BugReporterVisitors. Index: test/Analysis/delayed-template-parsing-crash.cpp =================================================================== --- test/Analysis/delayed-template-parsing-crash.cpp +++ test/Analysis/delayed-template-parsing-crash.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -std=c++11 -fdelayed-template-parsing -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -std=c++11 -fdelayed-template-parsing -verify %s // expected-no-diagnostics template struct remove_reference {typedef T type;}; Index: test/Analysis/delegates.m =================================================================== --- test/Analysis/delegates.m +++ test/Analysis/delegates.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -Wno-objc-root-class -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -Wno-objc-root-class -verify %s // expected-no-diagnostics Index: test/Analysis/derived-to-base.cpp =================================================================== --- test/Analysis/derived-to-base.cpp +++ test/Analysis/derived-to-base.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -DCONSTRUCTORS=1 -analyzer-config c++-inlining=constructors -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -DCONSTRUCTORS=1 -analyzer-config c++-inlining=constructors -verify %s void clang_analyzer_eval(bool); void clang_analyzer_checkInlined(bool); Index: test/Analysis/designated-initializer.c =================================================================== --- test/Analysis/designated-initializer.c +++ test/Analysis/designated-initializer.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG %s 2>&1 \ +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.DumpCFG %s 2>&1 \ // RUN: | FileCheck %s struct Q { int a, b, c; }; Index: test/Analysis/diagnostics/deref-track-symbolic-region.c =================================================================== --- test/Analysis/diagnostics/deref-track-symbolic-region.c +++ test/Analysis/diagnostics/deref-track-symbolic-region.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s struct S { Index: test/Analysis/diagnostics/deref-track-symbolic-region.cpp =================================================================== --- test/Analysis/diagnostics/deref-track-symbolic-region.cpp +++ test/Analysis/diagnostics/deref-track-symbolic-region.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s struct S { int *x; Index: test/Analysis/diagnostics/diag-cross-file-boundaries.c =================================================================== --- test/Analysis/diagnostics/diag-cross-file-boundaries.c +++ test/Analysis/diagnostics/diag-cross-file-boundaries.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=html -o PR12421.html %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=html -o PR12421.html %s 2>&1 | FileCheck %s // Test for PR12421 #include "diag-cross-file-boundaries.h" Index: test/Analysis/diagnostics/explicit-suppression.cpp =================================================================== --- test/Analysis/diagnostics/explicit-suppression.cpp +++ test/Analysis/diagnostics/explicit-suppression.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config suppress-c++-stdlib=false -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config suppress-c++-stdlib=true -DSUPPRESSED=1 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config suppress-c++-stdlib=false -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config suppress-c++-stdlib=true -DSUPPRESSED=1 -verify %s #ifdef SUPPRESSED // expected-no-diagnostics Index: test/Analysis/diagnostics/false-positive-suppression.c =================================================================== --- test/Analysis/diagnostics/false-positive-suppression.c +++ test/Analysis/diagnostics/false-positive-suppression.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -I %S/Inputs -analyze -analyzer-checker=core,unix -verify %s +// RUN: %clang_cc1 %z3_cc1 -I %S/Inputs -analyze -analyzer-checker=core,unix -verify %s // expected-no-diagnostics #include "include/sys/queue.h" Index: test/Analysis/diagnostics/implicit-cxx-std-suppression.cpp =================================================================== --- test/Analysis/diagnostics/implicit-cxx-std-suppression.cpp +++ test/Analysis/diagnostics/implicit-cxx-std-suppression.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=false -std=c++11 -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=true -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=false -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=true -std=c++11 -verify %s // expected-no-diagnostics Index: test/Analysis/diagnostics/macros.cpp =================================================================== --- test/Analysis/diagnostics/macros.cpp +++ test/Analysis/diagnostics/macros.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=core,osx -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++11 -analyzer-checker=core,osx -analyzer-output=text -verify %s #include "../Inputs/system-header-simulator.h" #include "../Inputs/system-header-simulator-cxx.h" Index: test/Analysis/diagnostics/macros.m =================================================================== --- test/Analysis/diagnostics/macros.m +++ test/Analysis/diagnostics/macros.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx -fblocks -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx -fblocks -analyzer-output=text -verify %s #include "../Inputs/system-header-simulator-objc.h" Index: test/Analysis/diagnostics/no-prune-paths.c =================================================================== --- test/Analysis/diagnostics/no-prune-paths.c +++ test/Analysis/diagnostics/no-prune-paths.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config prune-paths=false -DNPRUNE=1 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config prune-paths=false -DNPRUNE=1 -verify %s // "prune-paths" is a debug option only; this is just a simple test to see that // it's being honored. Index: test/Analysis/diagnostics/plist-diagnostics-include-check.cpp =================================================================== --- test/Analysis/diagnostics/plist-diagnostics-include-check.cpp +++ test/Analysis/diagnostics/plist-diagnostics-include-check.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=debug.ExprInspection -analyzer-output=plist-multi-file %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.ExprInspection -analyzer-output=plist-multi-file %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s #include "Inputs/include/plist-diagnostics-include-check-macro.h" Index: test/Analysis/diagnostics/report-issues-within-main-file.cpp =================================================================== --- test/Analysis/diagnostics/report-issues-within-main-file.cpp +++ test/Analysis/diagnostics/report-issues-within-main-file.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -analyzer-output=plist-multi-file -analyzer-config report-in-main-source-file=true -analyzer-config path-diagnostics-alternate=false %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix -analyzer-output=plist-multi-file -analyzer-config report-in-main-source-file=true -analyzer-config path-diagnostics-alternate=false %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s #include "Inputs/include/report-issues-within-main-file.h" Index: test/Analysis/diagnostics/shortest-path-suppression.c =================================================================== --- test/Analysis/diagnostics/shortest-path-suppression.c +++ test/Analysis/diagnostics/shortest-path-suppression.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-null-return-paths=true -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-null-return-paths=true -analyzer-output=text -verify %s // expected-no-diagnostics int *returnNull() { return 0; } Index: test/Analysis/diagnostics/text-diagnostics.c =================================================================== --- test/Analysis/diagnostics/text-diagnostics.c +++ test/Analysis/diagnostics/text-diagnostics.c @@ -1,4 +1,4 @@ -// RUN: %clang --analyze -Xanalyzer -analyzer-output=text -fno-caret-diagnostics %s 2>&1 | FileCheck %s +// RUN: %clang %z3 --analyze -Xanalyzer -analyzer-output=text -fno-caret-diagnostics %s 2>&1 | FileCheck %s void testA() { int *p = 0; Index: test/Analysis/diagnostics/undef-value-caller.c =================================================================== --- test/Analysis/diagnostics/undef-value-caller.c +++ test/Analysis/diagnostics/undef-value-caller.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false -o %t %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false -o %t %s // RUN: FileCheck --input-file %t %s #include "undef-value-callee.h" Index: test/Analysis/diagnostics/undef-value-param.c =================================================================== --- test/Analysis/diagnostics/undef-value-param.c +++ test/Analysis/diagnostics/undef-value-param.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s void foo_irrelevant(int c) { Index: test/Analysis/diagnostics/undef-value-param.m =================================================================== --- test/Analysis/diagnostics/undef-value-param.m +++ test/Analysis/diagnostics/undef-value-param.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx -analyzer-output=text -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s typedef signed char BOOL; Index: test/Analysis/disable-all-checks.c =================================================================== --- test/Analysis/disable-all-checks.c +++ test/Analysis/disable-all-checks.c @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-disable-all-checks -verify %s -// RUN: %clang_cc1 -analyze -analyzer-disable-all-checks -analyzer-checker=core -analyzer-store=region -verify %s -// RUN: %clang --analyze -Xanalyzer -analyzer-disable-all-checks -Xclang -verify %s -// RUN: not %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-disable-checker -verify %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-disable-all-checks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-disable-all-checks -analyzer-checker=core -analyzer-store=region -verify %s +// RUN: %clang %z3 --analyze -Xanalyzer -analyzer-disable-all-checks -Xclang -verify %s +// RUN: not %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-disable-checker -verify %s 2>&1 | FileCheck %s // expected-no-diagnostics // CHECK: use -analyzer-disable-all-checks to disable all static analyzer checkers Index: test/Analysis/dispatch-once.m =================================================================== --- test/Analysis/dispatch-once.m +++ test/Analysis/dispatch-once.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -w -fblocks -analyze -analyzer-checker=core,osx.API,unix.Malloc -verify %s -// RUN: %clang_cc1 -w -fblocks -fobjc-arc -analyze -analyzer-checker=core,osx.API,unix.Malloc -verify %s +// RUN: %clang_cc1 %z3_cc1 -w -fblocks -analyze -analyzer-checker=core,osx.API,unix.Malloc -verify %s +// RUN: %clang_cc1 %z3_cc1 -w -fblocks -fobjc-arc -analyze -analyzer-checker=core,osx.API,unix.Malloc -verify %s #include "Inputs/system-header-simulator-objc.h" Index: test/Analysis/div-zero.cpp =================================================================== --- test/Analysis/div-zero.cpp +++ test/Analysis/div-zero.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core.DivideZero -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core.DivideZero -verify %s int fooPR10616 (int qX ) { int a, c, d; Index: test/Analysis/division-by-zero.c =================================================================== --- test/Analysis/division-by-zero.c +++ test/Analysis/division-by-zero.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=unix.Malloc %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=unix.Malloc %s // Do not crash due to division by zero int f(unsigned int a) { Index: test/Analysis/domtest.c =================================================================== --- test/Analysis/domtest.c +++ test/Analysis/domtest.c @@ -1,5 +1,5 @@ // RUN: rm -f %t -// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpDominators %s > %t 2>&1 +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.DumpDominators %s > %t 2>&1 // RUN: FileCheck --input-file=%t %s // Test the DominatorsTree implementation with various control flows Index: test/Analysis/dtor-cxx11.cpp =================================================================== --- test/Analysis/dtor-cxx11.cpp +++ test/Analysis/dtor-cxx11.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config cfg-temporary-dtors=true -Wno-null-dereference -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++11 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config cfg-temporary-dtors=true -Wno-null-dereference -verify %s // expected-no-diagnostics #include "Inputs/system-header-simulator-cxx.h" Index: test/Analysis/dtor.cpp =================================================================== --- test/Analysis/dtor.cpp +++ test/Analysis/dtor.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection,cplusplus -analyzer-config c++-inlining=destructors,cfg-temporary-dtors=true -Wno-null-dereference -Wno-inaccessible-base -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection,cplusplus -analyzer-config c++-inlining=destructors,cfg-temporary-dtors=true -Wno-null-dereference -Wno-inaccessible-base -verify %s void clang_analyzer_eval(bool); void clang_analyzer_checkInlined(bool); Index: test/Analysis/dtors-in-dtor-cfg-output.cpp =================================================================== --- test/Analysis/dtors-in-dtor-cfg-output.cpp +++ test/Analysis/dtors-in-dtor-cfg-output.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s class A { public: Index: test/Analysis/dynamic-cast.cpp =================================================================== --- test/Analysis/dynamic-cast.cpp +++ test/Analysis/dynamic-cast.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=none -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=none -verify %s void clang_analyzer_eval(bool); Index: test/Analysis/dynamic_type_check.m =================================================================== --- test/Analysis/dynamic_type_check.m +++ test/Analysis/dynamic_type_check.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core.DynamicTypeChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core.DynamicTypeChecker -verify %s #define nil 0 Index: test/Analysis/edges-new.mm =================================================================== --- test/Analysis/edges-new.mm +++ test/Analysis/edges-new.mm @@ -1,4 +1,4 @@ -// RUN: %clang -target x86_64-apple-darwin10 --analyze -Xclang -analyzer-config -Xclang path-diagnostics-alternate=true -Xclang -analyzer-output=plist -o %t %s +// RUN: %clang %z3 -target x86_64-apple-darwin10 --analyze -Xclang -analyzer-config -Xclang path-diagnostics-alternate=true -Xclang -analyzer-output=plist -o %t %s // RUN: FileCheck --input-file %t %s //===----------------------------------------------------------------------===// Index: test/Analysis/elementtype.c =================================================================== --- test/Analysis/elementtype.c +++ test/Analysis/elementtype.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region %s typedef struct added_obj_st { int type; Index: test/Analysis/engine/replay-without-inlining.c =================================================================== --- test/Analysis/engine/replay-without-inlining.c +++ test/Analysis/engine/replay-without-inlining.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc -verify %s // expected-no-diagnostics typedef struct { Index: test/Analysis/enum.cpp =================================================================== --- test/Analysis/enum.cpp +++ test/Analysis/enum.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=debug.ExprInspection %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++11 -analyzer-checker=debug.ExprInspection %s void clang_analyzer_eval(bool); Index: test/Analysis/exceptions.mm =================================================================== --- test/Analysis/exceptions.mm +++ test/Analysis/exceptions.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -fexceptions -fobjc-exceptions -fcxx-exceptions -analyzer-checker=core,unix.Malloc,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -fexceptions -fobjc-exceptions -fcxx-exceptions -analyzer-checker=core,unix.Malloc,debug.ExprInspection -verify %s void clang_analyzer_checkInlined(bool); Index: test/Analysis/exercise-ps.c =================================================================== --- test/Analysis/exercise-ps.c +++ test/Analysis/exercise-ps.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s // // Just exercise the analyzer on code that has at one point caused issues // (i.e., no assertions or crashes). Index: test/Analysis/explain-svals.cpp =================================================================== --- test/Analysis/explain-svals.cpp +++ test/Analysis/explain-svals.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core.builtin,debug.ExprInspection,unix.cstring -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core.builtin,debug.ExprInspection,unix.cstring -verify %s typedef unsigned long size_t; Index: test/Analysis/explain-svals.m =================================================================== --- test/Analysis/explain-svals.m +++ test/Analysis/explain-svals.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -w -triple i386-apple-darwin10 -fblocks -analyze -analyzer-checker=core.builtin,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -w -triple i386-apple-darwin10 -fblocks -analyze -analyzer-checker=core.builtin,debug.ExprInspection -verify %s #include "Inputs/system-header-simulator-objc.h" Index: test/Analysis/expr-inspection.c =================================================================== --- test/Analysis/expr-inspection.c +++ test/Analysis/expr-inspection.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=debug.ExprInspection -verify %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.ExprInspection -verify %s 2>&1 | FileCheck %s // Self-tests for the debug.ExprInspection checker. @@ -19,4 +19,4 @@ // CHECK: Expressions: // CHECK-NEXT: clang_analyzer_printState : &code{clang_analyzer_printState} -// CHECK-NEXT: Ranges are empty. +// CHECK-NEXT: {{(Ranges are empty)|(Constraints:[[:space:]]*$)}} Index: test/Analysis/fields.c =================================================================== --- test/Analysis/fields.c +++ test/Analysis/fields.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection %s -analyzer-store=region -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection %s -analyzer-store=region -verify void clang_analyzer_eval(int); Index: test/Analysis/free.c =================================================================== --- test/Analysis/free.c +++ test/Analysis/free.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-checker=core,unix.Malloc -fblocks -verify %s -// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-checker=core,unix.Malloc -fblocks -verify -analyzer-config unix.Malloc:Optimistic=true %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-store=region -analyzer-checker=core,unix.Malloc -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-store=region -analyzer-checker=core,unix.Malloc -fblocks -verify -analyzer-config unix.Malloc:Optimistic=true %s typedef __typeof(sizeof(int)) size_t; void free(void *); void *alloca(size_t); Index: test/Analysis/func.c =================================================================== --- test/Analysis/func.c +++ test/Analysis/func.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify %s void clang_analyzer_eval(int); void clang_analyzer_warnIfReached(); Index: test/Analysis/generics.m =================================================================== --- test/Analysis/generics.m +++ test/Analysis/generics.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.ObjCGenerics,alpha.core.DynamicTypeChecker -verify -Wno-objc-method-access %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.ObjCGenerics,alpha.core.DynamicTypeChecker -verify -Wno-objc-method-access %s -analyzer-output=plist -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.ObjCGenerics,alpha.core.DynamicTypeChecker -verify -Wno-objc-method-access %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.ObjCGenerics,alpha.core.DynamicTypeChecker -verify -Wno-objc-method-access %s -analyzer-output=plist -o %t.plist // RUN: FileCheck --input-file %t.plist %s #if !__has_feature(objc_generics) Index: test/Analysis/global-region-invalidation.c =================================================================== --- test/Analysis/global-region-invalidation.c +++ test/Analysis/global-region-invalidation.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -disable-free -analyzer-eagerly-assume -analyzer-checker=core,deadcode,alpha.security.taint,debug.TaintTest,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -disable-free -analyzer-eagerly-assume -analyzer-checker=core,deadcode,alpha.security.taint,debug.TaintTest,debug.ExprInspection -verify %s void clang_analyzer_eval(int); Index: test/Analysis/global_region_invalidation.mm =================================================================== --- test/Analysis/global_region_invalidation.mm +++ test/Analysis/global_region_invalidation.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s void clang_analyzer_eval(int); Index: test/Analysis/gtest.cpp =================================================================== --- test/Analysis/gtest.cpp +++ test/Analysis/gtest.cpp @@ -1,6 +1,6 @@ -//RUN: %clang_cc1 -cc1 -std=c++11 -analyze -analyzer-checker=core,apiModeling.google.GTest,debug.ExprInspection -analyzer-eagerly-assume %s -verify -//RUN: %clang_cc1 -cc1 -std=c++11 -analyze -analyzer-checker=core,apiModeling.google.GTest,debug.ExprInspection -analyzer-eagerly-assume -DGTEST_VERSION_1_8_AND_LATER=1 %s -verify -//RUN: %clang_cc1 -cc1 -std=c++11 -analyze -analyzer-checker=core,apiModeling.google.GTest,debug.ExprInspection -analyzer-eagerly-assume -analyzer-config cfg-temporary-dtors=true %s -verify +//RUN: %clang_cc1 %z3_cc1 -cc1 -std=c++11 -analyze -analyzer-checker=core,apiModeling.google.GTest,debug.ExprInspection -analyzer-eagerly-assume %s -verify +//RUN: %clang_cc1 %z3_cc1 -cc1 -std=c++11 -analyze -analyzer-checker=core,apiModeling.google.GTest,debug.ExprInspection -analyzer-eagerly-assume -DGTEST_VERSION_1_8_AND_LATER=1 %s -verify +//RUN: %clang_cc1 %z3_cc1 -cc1 -std=c++11 -analyze -analyzer-checker=core,apiModeling.google.GTest,debug.ExprInspection -analyzer-eagerly-assume -analyzer-config cfg-temporary-dtors=true %s -verify void clang_analyzer_eval(int); void clang_analyzer_warnIfReached(); Index: test/Analysis/html-diags-multifile.c =================================================================== --- test/Analysis/html-diags-multifile.c +++ test/Analysis/html-diags-multifile.c @@ -1,5 +1,5 @@ // RUN: mkdir -p %t.dir -// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t.dir %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t.dir %s // RUN: ls %t.dir | not grep report // RUN: rm -fR %t.dir Index: test/Analysis/html-diags.c =================================================================== --- test/Analysis/html-diags.c +++ test/Analysis/html-diags.c @@ -1,11 +1,11 @@ // RUN: rm -fR %T/dir // RUN: mkdir %T/dir -// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %T/dir %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %T/dir %s // RUN: ls %T/dir | grep report // PR16547: Test relative paths // RUN: cd %T/dir -// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o testrelative %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o testrelative %s // RUN: ls %T/dir/testrelative | grep report // Currently this test mainly checks that the HTML diagnostics doesn't crash Index: test/Analysis/identical-expressions.cpp =================================================================== --- test/Analysis/identical-expressions.cpp +++ test/Analysis/identical-expressions.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core.IdenticalExpr -w -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core.IdenticalExpr -w -verify %s /* Only one expected warning per function allowed at the very end. */ Index: test/Analysis/index-type.c =================================================================== --- test/Analysis/index-type.c +++ test/Analysis/index-type.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,alpha.security.ArrayBoundV2 -verify %s -// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,alpha.security.ArrayBoundV2 -DM32 -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,alpha.security.ArrayBoundV2 -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,alpha.security.ArrayBoundV2 -DM32 -verify %s // expected-no-diagnostics #define UINT_MAX (~0u) Index: test/Analysis/initializer.cpp =================================================================== --- test/Analysis/initializer.cpp +++ test/Analysis/initializer.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config c++-inlining=constructors -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config c++-inlining=constructors -std=c++11 -verify %s void clang_analyzer_eval(bool); Index: test/Analysis/initializers-cfg-output.cpp =================================================================== --- test/Analysis/initializers-cfg-output.cpp +++ test/Analysis/initializers-cfg-output.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -analyze -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -analyze -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s class A { public: Index: test/Analysis/inline-not-supported.c =================================================================== --- test/Analysis/inline-not-supported.c +++ test/Analysis/inline-not-supported.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fblocks -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -fblocks -analyze -analyzer-checker=core -verify %s // For now, don't inline varargs. void foo(int *x, ...) { Index: test/Analysis/inline-plist.c =================================================================== --- test/Analysis/inline-plist.c +++ test/Analysis/inline-plist.c @@ -1,5 +1,5 @@ -// RUN: %clang --analyze %s -fblocks -Xanalyzer -analyzer-output=text -Xanalyzer -analyzer-config -Xanalyzer suppress-null-return-paths=false -Xclang -verify %s -// RUN: %clang --analyze %s -fblocks -Xanalyzer -analyzer-config -Xanalyzer suppress-null-return-paths=false -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -o %t +// RUN: %clang %z3 --analyze %s -fblocks -Xanalyzer -analyzer-output=text -Xanalyzer -analyzer-config -Xanalyzer suppress-null-return-paths=false -Xclang -verify %s +// RUN: %clang %z3 --analyze %s -fblocks -Xanalyzer -analyzer-config -Xanalyzer suppress-null-return-paths=false -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -o %t // RUN: FileCheck -input-file %t %s // Index: test/Analysis/inline-unique-reports.c =================================================================== --- test/Analysis/inline-unique-reports.c +++ test/Analysis/inline-unique-reports.c @@ -1,4 +1,4 @@ -// RUN: %clang --analyze %s -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -o %t > /dev/null 2>&1 +// RUN: %clang %z3 --analyze %s -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -o %t > /dev/null 2>&1 // RUN: FileCheck -input-file %t %s static inline bug(int *p) { Index: test/Analysis/inline.c =================================================================== --- test/Analysis/inline.c +++ test/Analysis/inline.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s void clang_analyzer_eval(int); void clang_analyzer_checkInlined(int); Index: test/Analysis/inline.cpp =================================================================== --- test/Analysis/inline.cpp +++ test/Analysis/inline.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config ipa=inlining -analyzer-config c++-allocator-inlining=true -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config ipa=inlining -analyzer-config c++-allocator-inlining=true -verify %s void clang_analyzer_eval(bool); void clang_analyzer_checkInlined(bool); Index: test/Analysis/inline2.c =================================================================== --- test/Analysis/inline2.c +++ test/Analysis/inline2.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify %s // expected-no-diagnostics // Test parameter 'a' is registered to LiveVariables analysis data although it Index: test/Analysis/inline3.c =================================================================== --- test/Analysis/inline3.c +++ test/Analysis/inline3.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify %s // expected-no-diagnostics // Test when entering f1(), we set the right AnalysisDeclContext to Environment. Index: test/Analysis/inline4.c =================================================================== --- test/Analysis/inline4.c +++ test/Analysis/inline4.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify %s // expected-no-diagnostics int g(int a) { Index: test/Analysis/inlining/DynDispatchBifurcate.m =================================================================== --- test/Analysis/inlining/DynDispatchBifurcate.m +++ test/Analysis/inlining/DynDispatchBifurcate.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx -analyzer-config ipa=dynamic-bifurcate -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx -analyzer-config ipa=dynamic-bifurcate -verify %s #include "InlineObjCInstanceMethod.h" Index: test/Analysis/inlining/InlineObjCClassMethod.m =================================================================== --- test/Analysis/inlining/InlineObjCClassMethod.m +++ test/Analysis/inlining/InlineObjCClassMethod.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=dynamic-bifurcate -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=dynamic-bifurcate -verify %s void clang_analyzer_checkInlined(int); void clang_analyzer_eval(int); Index: test/Analysis/inlining/InlineObjCInstanceMethod.m =================================================================== --- test/Analysis/inlining/InlineObjCInstanceMethod.m +++ test/Analysis/inlining/InlineObjCInstanceMethod.m @@ -1,4 +1,4 @@ -// RUN: %clang --analyze -Xanalyzer -analyzer-checker=osx.cocoa.IncompatibleMethodTypes,osx.coreFoundation.CFRetainRelease -Xclang -verify %s +// RUN: %clang %z3 --analyze -Xanalyzer -analyzer-checker=osx.cocoa.IncompatibleMethodTypes,osx.coreFoundation.CFRetainRelease -Xclang -verify %s #include "InlineObjCInstanceMethod.h" Index: test/Analysis/inlining/ObjCDynTypePopagation.m =================================================================== --- test/Analysis/inlining/ObjCDynTypePopagation.m +++ test/Analysis/inlining/ObjCDynTypePopagation.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=dynamic-bifurcate -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=dynamic-bifurcate -verify %s #include "InlineObjCInstanceMethod.h" Index: test/Analysis/inlining/ObjCImproperDynamictallyDetectableCast.m =================================================================== --- test/Analysis/inlining/ObjCImproperDynamictallyDetectableCast.m +++ test/Analysis/inlining/ObjCImproperDynamictallyDetectableCast.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=dynamic-bifurcate -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=dynamic-bifurcate -verify %s typedef signed char BOOL; @protocol NSObject - (BOOL)isEqual:(id)object; @end Index: test/Analysis/inlining/RetainCountExamples.m =================================================================== --- test/Analysis/inlining/RetainCountExamples.m +++ test/Analysis/inlining/RetainCountExamples.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-config ipa=dynamic-bifurcate -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-config ipa=dynamic-bifurcate -verify %s typedef signed char BOOL; typedef struct objc_class *Class; Index: test/Analysis/inlining/analysis-order.c =================================================================== --- test/Analysis/inlining/analysis-order.c +++ test/Analysis/inlining/analysis-order.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core.builtin.NoReturnFunctions -analyzer-display-progress %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core.builtin.NoReturnFunctions -analyzer-display-progress %s 2>&1 | FileCheck %s // Do not analyze test1() again because it was inlined void test1(); Index: test/Analysis/inlining/assume-super-init-does-not-return-nil.m =================================================================== --- test/Analysis/inlining/assume-super-init-does-not-return-nil.m +++ test/Analysis/inlining/assume-super-init-does-not-return-nil.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx -verify %s typedef signed char BOOL; Index: test/Analysis/inlining/containers.cpp =================================================================== --- test/Analysis/inlining/containers.cpp +++ test/Analysis/inlining/containers.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config c++-inlining=destructors -analyzer-config c++-container-inlining=false -verify %s -// RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config c++-inlining=destructors -analyzer-config c++-container-inlining=true -DINLINE=1 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++11 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config c++-inlining=destructors -analyzer-config c++-container-inlining=false -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -std=c++11 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config c++-inlining=destructors -analyzer-config c++-container-inlining=true -DINLINE=1 -verify %s #ifndef HEADER Index: test/Analysis/inlining/dyn-dispatch-bifurcate.cpp =================================================================== --- test/Analysis/inlining/dyn-dispatch-bifurcate.cpp +++ test/Analysis/inlining/dyn-dispatch-bifurcate.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=dynamic-bifurcate -verify -Wno-reinterpret-base-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=dynamic-bifurcate -verify -Wno-reinterpret-base-class %s void clang_analyzer_eval(bool); Index: test/Analysis/inlining/eager-reclamation-path-notes.c =================================================================== --- test/Analysis/inlining/eager-reclamation-path-notes.c +++ test/Analysis/inlining/eager-reclamation-path-notes.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config graph-trim-interval=5 -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config graph-trim-interval=5 -analyzer-config path-diagnostics-alternate=false %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config graph-trim-interval=5 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config graph-trim-interval=5 -analyzer-config path-diagnostics-alternate=false %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s void use(int *ptr, int val) { Index: test/Analysis/inlining/eager-reclamation-path-notes.cpp =================================================================== --- test/Analysis/inlining/eager-reclamation-path-notes.cpp +++ test/Analysis/inlining/eager-reclamation-path-notes.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config graph-trim-interval=5 -analyzer-config suppress-null-return-paths=false -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config graph-trim-interval=5 -analyzer-config suppress-null-return-paths=false -analyzer-config path-diagnostics-alternate=false %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config graph-trim-interval=5 -analyzer-config suppress-null-return-paths=false -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config graph-trim-interval=5 -analyzer-config suppress-null-return-paths=false -analyzer-config path-diagnostics-alternate=false %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s typedef struct { Index: test/Analysis/inlining/false-positive-suppression.c =================================================================== --- test/Analysis/inlining/false-positive-suppression.c +++ test/Analysis/inlining/false-positive-suppression.c @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -analyze -analyzer-eagerly-assume -analyzer-checker=core -analyzer-config suppress-null-return-paths=false -verify %s -// RUN: %clang_cc1 -analyze -analyzer-eagerly-assume -analyzer-checker=core -verify -DSUPPRESSED=1 %s -// RUN: %clang_cc1 -analyze -analyzer-eagerly-assume -analyzer-checker=core -analyzer-config avoid-suppressing-null-argument-paths=true -DSUPPRESSED=1 -DNULL_ARGS=1 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-eagerly-assume -analyzer-checker=core -analyzer-config suppress-null-return-paths=false -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-eagerly-assume -analyzer-checker=core -verify -DSUPPRESSED=1 %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-eagerly-assume -analyzer-checker=core -analyzer-config avoid-suppressing-null-argument-paths=true -DSUPPRESSED=1 -DNULL_ARGS=1 -verify %s int opaquePropertyCheck(void *object); int coin(); Index: test/Analysis/inlining/false-positive-suppression.cpp =================================================================== --- test/Analysis/inlining/false-positive-suppression.cpp +++ test/Analysis/inlining/false-positive-suppression.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-null-return-paths=false -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -DSUPPRESSED=1 %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-null-return-paths=false -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify -DSUPPRESSED=1 %s namespace rdar12676053 { // Delta-reduced from a preprocessed file. Index: test/Analysis/inlining/false-positive-suppression.m =================================================================== --- test/Analysis/inlining/false-positive-suppression.m +++ test/Analysis/inlining/false-positive-suppression.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-null-return-paths=false -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -DSUPPRESSED=1 %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -fobjc-arc -verify -DSUPPRESSED=1 %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-config avoid-suppressing-null-argument-paths=true -DSUPPRESSED=1 -DNULL_ARGS=1 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-null-return-paths=false -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify -DSUPPRESSED=1 %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -fobjc-arc -verify -DSUPPRESSED=1 %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-config avoid-suppressing-null-argument-paths=true -DSUPPRESSED=1 -DNULL_ARGS=1 -verify %s #define ARC __has_feature(objc_arc) Index: test/Analysis/inlining/inline-defensive-checks.c =================================================================== --- test/Analysis/inlining/inline-defensive-checks.c +++ test/Analysis/inlining/inline-defensive-checks.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-inlined-defensive-checks=true -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-inlined-defensive-checks=true -verify %s // Perform inline defensive checks. void idc(int *p) { Index: test/Analysis/inlining/inline-defensive-checks.cpp =================================================================== --- test/Analysis/inlining/inline-defensive-checks.cpp +++ test/Analysis/inlining/inline-defensive-checks.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify %s // expected-no-diagnostics extern void __assert_fail (__const char *__assertion, __const char *__file, Index: test/Analysis/inlining/inline-defensive-checks.m =================================================================== --- test/Analysis/inlining/inline-defensive-checks.m +++ test/Analysis/inlining/inline-defensive-checks.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-inlined-defensive-checks=true -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-inlined-defensive-checks=true -verify %s typedef signed char BOOL; typedef struct objc_class *Class; Index: test/Analysis/inlining/path-notes.c =================================================================== --- test/Analysis/inlining/path-notes.c +++ test/Analysis/inlining/path-notes.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config suppress-null-return-paths=false -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config suppress-null-return-paths=false -analyzer-config path-diagnostics-alternate=false %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config suppress-null-return-paths=false -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config suppress-null-return-paths=false -analyzer-config path-diagnostics-alternate=false %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s void zero(int **p) { Index: test/Analysis/inlining/path-notes.cpp =================================================================== --- test/Analysis/inlining/path-notes.cpp +++ test/Analysis/inlining/path-notes.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config c++-inlining=destructors -std=c++11 -verify -Wno-tautological-undefined-compare %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config c++-inlining=destructors -std=c++11 -analyzer-config path-diagnostics-alternate=false %s -o %t.plist -Wno-tautological-undefined-compare +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config c++-inlining=destructors -std=c++11 -verify -Wno-tautological-undefined-compare %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config c++-inlining=destructors -std=c++11 -analyzer-config path-diagnostics-alternate=false %s -o %t.plist -Wno-tautological-undefined-compare // RUN: FileCheck --input-file=%t.plist %s class Foo { Index: test/Analysis/inlining/path-notes.m =================================================================== --- test/Analysis/inlining/path-notes.m +++ test/Analysis/inlining/path-notes.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount -analyzer-output=text -analyzer-config suppress-null-return-paths=false -fblocks -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount -analyzer-output=plist-multi-file -analyzer-config suppress-null-return-paths=false -analyzer-config path-diagnostics-alternate=false -fblocks %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount -analyzer-output=text -analyzer-config suppress-null-return-paths=false -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.NilArg,osx.cocoa.RetainCount -analyzer-output=plist-multi-file -analyzer-config suppress-null-return-paths=false -analyzer-config path-diagnostics-alternate=false -fblocks %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s typedef struct dispatch_queue_s *dispatch_queue_t; Index: test/Analysis/inlining/retain-count-self-init.m =================================================================== --- test/Analysis/inlining/retain-count-self-init.m +++ test/Analysis/inlining/retain-count-self-init.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,osx.cocoa.SelfInit -analyzer-config ipa=dynamic-bifurcate -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,osx.cocoa.SelfInit -analyzer-config ipa=dynamic-bifurcate -verify %s typedef signed char BOOL; typedef struct objc_class *Class; Index: test/Analysis/inlining/stl.cpp =================================================================== --- test/Analysis/inlining/stl.cpp +++ test/Analysis/inlining/stl.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=false -std=c++11 -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=true -std=c++11 -DINLINE=1 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=false -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=true -std=c++11 -DINLINE=1 -verify %s #include "../Inputs/system-header-simulator-cxx.h" Index: test/Analysis/inlining/test-always-inline-size-option.c =================================================================== --- test/Analysis/inlining/test-always-inline-size-option.c +++ test/Analysis/inlining/test-always-inline-size-option.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-inline-max-stack-depth=3 -analyzer-config ipa-always-inline-size=3 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-inline-max-stack-depth=3 -analyzer-config ipa-always-inline-size=3 -verify %s void clang_analyzer_eval(int); int nested5() { Index: test/Analysis/inlining/test_objc_inlining_option.m =================================================================== --- test/Analysis/inlining/test_objc_inlining_option.m +++ test/Analysis/inlining/test_objc_inlining_option.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-config ipa=dynamic-bifurcate -analyzer-config objc-inlining=false -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-config ipa=dynamic-bifurcate -analyzer-config objc-inlining=false -verify %s // expected-no-diagnostics typedef signed char BOOL; Index: test/Analysis/iterator-past-end.cpp =================================================================== --- test/Analysis/iterator-past-end.cpp +++ test/Analysis/iterator-past-end.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=c++11 -analyze -analyzer-checker=core,cplusplus,alpha.cplusplus.IteratorPastEnd -analyzer-eagerly-assume -analyzer-config c++-container-inlining=false %s -verify -// RUN: %clang_cc1 -std=c++11 -analyze -analyzer-checker=core,cplusplus,alpha.cplusplus.IteratorPastEnd -analyzer-eagerly-assume -analyzer-config c++-container-inlining=true -DINLINE=1 %s -verify +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -analyze -analyzer-checker=core,cplusplus,alpha.cplusplus.IteratorPastEnd -analyzer-eagerly-assume -analyzer-config c++-container-inlining=false %s -verify +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -analyze -analyzer-checker=core,cplusplus,alpha.cplusplus.IteratorPastEnd -analyzer-eagerly-assume -analyzer-config c++-container-inlining=true -DINLINE=1 %s -verify #include "Inputs/system-header-simulator-cxx.h" Index: test/Analysis/ivars.m =================================================================== --- test/Analysis/ivars.m +++ test/Analysis/ivars.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store=region -fblocks -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store=region -fblocks -verify -Wno-objc-root-class %s void clang_analyzer_eval(int); Index: test/Analysis/keychainAPI-diagnostic-visitor.m =================================================================== --- test/Analysis/keychainAPI-diagnostic-visitor.m +++ test/Analysis/keychainAPI-diagnostic-visitor.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=osx.SecKeychainAPI -analyzer-store=region -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=osx.SecKeychainAPI -analyzer-store=region -analyzer-output=text -verify %s // This file is for testing enhanced diagnostics produced by the default SecKeychainAPI checker. Index: test/Analysis/keychainAPI.m =================================================================== --- test/Analysis/keychainAPI.m +++ test/Analysis/keychainAPI.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=osx.SecKeychainAPI -fblocks %s -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=osx.SecKeychainAPI -fblocks %s -verify #include "Inputs/system-header-simulator-objc.h" Index: test/Analysis/kmalloc-linux.c =================================================================== --- test/Analysis/kmalloc-linux.c +++ test/Analysis/kmalloc-linux.c @@ -1,4 +1,4 @@ -// RUN: %clang -target x86_64-unknown-linux --analyze %s +// RUN: %clang %z3 -target x86_64-unknown-linux --analyze %s #include "Inputs/system-header-simulator.h" Index: test/Analysis/lambda-notes.cpp =================================================================== --- test/Analysis/lambda-notes.cpp +++ test/Analysis/lambda-notes.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -fsyntax-only -analyze -analyzer-checker=core -analyzer-config inline-lambdas=true -analyzer-output plist -verify %s -o %t +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -fsyntax-only -analyze -analyzer-checker=core -analyzer-config inline-lambdas=true -analyzer-output plist -verify %s -o %t // RUN: FileCheck --input-file=%t %s Index: test/Analysis/lambdas-generalized-capture.cpp =================================================================== --- test/Analysis/lambdas-generalized-capture.cpp +++ test/Analysis/lambdas-generalized-capture.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++14 -fsyntax-only -analyze -analyzer-checker=core,deadcode,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -std=c++14 -fsyntax-only -analyze -analyzer-checker=core,deadcode,debug.ExprInspection -verify %s int clang_analyzer_eval(int); Index: test/Analysis/lambdas.cpp =================================================================== --- test/Analysis/lambdas.cpp +++ test/Analysis/lambdas.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=c++11 -fsyntax-only -analyze -analyzer-checker=core,deadcode,debug.ExprInspection -analyzer-config inline-lambdas=true -verify %s -// RUN: %clang_cc1 -std=c++11 -fsyntax-only -analyze -analyzer-checker=core,debug.DumpCFG -analyzer-config inline-lambdas=true %s > %t 2>&1 +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -fsyntax-only -analyze -analyzer-checker=core,deadcode,debug.ExprInspection -analyzer-config inline-lambdas=true -verify %s +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -fsyntax-only -analyze -analyzer-checker=core,debug.DumpCFG -analyzer-config inline-lambdas=true %s > %t 2>&1 // RUN: FileCheck --input-file=%t %s void clang_analyzer_warnIfReached(); Index: test/Analysis/lambdas.mm =================================================================== --- test/Analysis/lambdas.mm +++ test/Analysis/lambdas.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fblocks -Wno-objc-root-class -analyze -analyzer-checker=core,deadcode,debug.ExprInspection -analyzer-config inline-lambdas=true -verify %s +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -fsyntax-only -fblocks -Wno-objc-root-class -analyze -analyzer-checker=core,deadcode,debug.ExprInspection -analyzer-config inline-lambdas=true -verify %s int clang_analyzer_eval(int); Index: test/Analysis/lifetime-extension.cpp =================================================================== --- test/Analysis/lifetime-extension.cpp +++ test/Analysis/lifetime-extension.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-unused -std=c++11 -analyze -analyzer-checker=debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -Wno-unused -std=c++11 -analyze -analyzer-checker=debug.ExprInspection -verify %s void clang_analyzer_eval(bool); Index: test/Analysis/live-variables.cpp =================================================================== --- test/Analysis/live-variables.cpp +++ test/Analysis/live-variables.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify %s // expected-no-diagnostics class B { public: Index: test/Analysis/live-variables.m =================================================================== --- test/Analysis/live-variables.m +++ test/Analysis/live-variables.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -fobjc-arc -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -fobjc-arc -verify %s // expected-no-diagnostics @interface NSObject @end Index: test/Analysis/localization-aggressive.m =================================================================== --- test/Analysis/localization-aggressive.m +++ test/Analysis/localization-aggressive.m @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -fblocks -x objective-c-header -emit-pch -o %t.pch %S/Inputs/localization-pch.h +// RUN: %clang_cc1 %z3_cc1 -fblocks -x objective-c-header -emit-pch -o %t.pch %S/Inputs/localization-pch.h -// RUN: %clang_cc1 -analyze -fblocks -analyzer-store=region -analyzer-checker=optin.osx.cocoa.localizability.NonLocalizedStringChecker -analyzer-checker=optin.osx.cocoa.localizability.EmptyLocalizationContextChecker -include-pch %t.pch -verify -analyzer-config AggressiveReport=true %s +// RUN: %clang_cc1 %z3_cc1 -analyze -fblocks -analyzer-store=region -analyzer-checker=optin.osx.cocoa.localizability.NonLocalizedStringChecker -analyzer-checker=optin.osx.cocoa.localizability.EmptyLocalizationContextChecker -include-pch %t.pch -verify -analyzer-config AggressiveReport=true %s // These declarations were reduced using Delta-Debugging from Foundation.h // on Mac OS X. Index: test/Analysis/localization.m =================================================================== --- test/Analysis/localization.m +++ test/Analysis/localization.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -fblocks -analyzer-store=region -analyzer-output=text -analyzer-checker=optin.osx.cocoa.localizability.NonLocalizedStringChecker -analyzer-checker=alpha.osx.cocoa.localizability.PluralMisuseChecker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -fblocks -analyzer-store=region -analyzer-output=text -analyzer-checker=optin.osx.cocoa.localizability.NonLocalizedStringChecker -analyzer-checker=alpha.osx.cocoa.localizability.PluralMisuseChecker -verify %s // The larger set of tests in located in localization.m. These are tests // specific for non-aggressive reporting. Index: test/Analysis/logical-ops.c =================================================================== --- test/Analysis/logical-ops.c +++ test/Analysis/logical-ops.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-pointer-bool-conversion -analyze -analyzer-checker=core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -Wno-pointer-bool-conversion -analyze -analyzer-checker=core,debug.ExprInspection -verify %s void clang_analyzer_eval(int); Index: test/Analysis/loop-widening.c =================================================================== --- test/Analysis/loop-widening.c +++ test/Analysis/loop-widening.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-max-loop 4 -analyzer-config widen-loops=true -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-max-loop 4 -analyzer-config widen-loops=true -verify %s void clang_analyzer_eval(int); void clang_analyzer_warnIfReached(); Index: test/Analysis/lvalue.cpp =================================================================== --- test/Analysis/lvalue.cpp +++ test/Analysis/lvalue.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s // expected-no-diagnostics int f1() { Index: test/Analysis/malloc-annotations.c =================================================================== --- test/Analysis/malloc-annotations.c +++ test/Analysis/malloc-annotations.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc -analyzer-store=region -verify -analyzer-config unix.Malloc:Optimistic=true %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc -analyzer-store=region -verify -analyzer-config unix.Malloc:Optimistic=true %s typedef __typeof(sizeof(int)) size_t; void *malloc(size_t); void free(void *); Index: test/Analysis/malloc-custom.c =================================================================== --- test/Analysis/malloc-custom.c +++ test/Analysis/malloc-custom.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -Wno-incompatible-library-redeclaration -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc -Wno-incompatible-library-redeclaration -verify %s // Various tests to make the the analyzer is robust against custom // redeclarations of memory routines. Index: test/Analysis/malloc-interprocedural.c =================================================================== --- test/Analysis/malloc-interprocedural.c +++ test/Analysis/malloc-interprocedural.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=unix.Malloc -analyzer-inline-max-stack-depth=5 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=unix.Malloc -analyzer-inline-max-stack-depth=5 -verify %s #include "Inputs/system-header-simulator.h" Index: test/Analysis/malloc-overflow.c =================================================================== --- test/Analysis/malloc-overflow.c +++ test/Analysis/malloc-overflow.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.security.MallocOverflow -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.security.MallocOverflow -verify %s #define NULL ((void *) 0) typedef __typeof__(sizeof(int)) size_t; Index: test/Analysis/malloc-overflow.cpp =================================================================== --- test/Analysis/malloc-overflow.cpp +++ test/Analysis/malloc-overflow.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.security.MallocOverflow -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.security.MallocOverflow -verify %s // expected-no-diagnostics class A { Index: test/Analysis/malloc-overflow2.c =================================================================== --- test/Analysis/malloc-overflow2.c +++ test/Analysis/malloc-overflow2.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -analyze -analyzer-checker=alpha.security.MallocOverflow,unix -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-unknown-unknown -analyze -analyzer-checker=alpha.security.MallocOverflow,unix -verify %s typedef __typeof__(sizeof(int)) size_t; extern void *malloc(size_t); Index: test/Analysis/malloc-plist.c =================================================================== --- test/Analysis/malloc-plist.c +++ test/Analysis/malloc-plist.c @@ -1,5 +1,5 @@ // RUN: rm -f %t -// RUN: %clang_cc1 -analyze -fblocks -analyzer-checker=core,unix.Malloc -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false -o %t %s +// RUN: %clang_cc1 %z3_cc1 -analyze -fblocks -analyzer-checker=core,unix.Malloc -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false -o %t %s // RUN: FileCheck -input-file %t %s typedef __typeof(sizeof(int)) size_t; Index: test/Analysis/malloc-protoype.c =================================================================== --- test/Analysis/malloc-protoype.c +++ test/Analysis/malloc-protoype.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -w -analyze -analyzer-checker=core,unix.Malloc -verify %s +// RUN: %clang_cc1 %z3_cc1 -w -analyze -analyzer-checker=core,unix.Malloc -verify %s // expected-no-diagnostics // Test that strange prototypes doesn't crash the analyzer Index: test/Analysis/malloc-sizeof.c =================================================================== --- test/Analysis/malloc-sizeof.c +++ test/Analysis/malloc-sizeof.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=unix.MallocSizeof -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=unix.MallocSizeof -verify %s #include Index: test/Analysis/malloc-sizeof.cpp =================================================================== --- test/Analysis/malloc-sizeof.cpp +++ test/Analysis/malloc-sizeof.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=unix.MallocSizeof -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=unix.MallocSizeof -verify %s #include Index: test/Analysis/malloc-three-arg.c =================================================================== --- test/Analysis/malloc-three-arg.c +++ test/Analysis/malloc-three-arg.c @@ -1,4 +1,4 @@ -// RUN: %clang -target x86_64-unknown-freebsd --analyze %s +// RUN: %clang %z3 -target x86_64-unknown-freebsd --analyze %s #include "Inputs/system-header-simulator.h" Index: test/Analysis/malloc.c =================================================================== --- test/Analysis/malloc.c +++ test/Analysis/malloc.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,debug.ExprInspection -analyzer-store=region -verify %s #include "Inputs/system-header-simulator.h" Index: test/Analysis/malloc.cpp =================================================================== --- test/Analysis/malloc.cpp +++ test/Analysis/malloc.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -w -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,cplusplus.NewDelete -analyzer-store=region -verify %s -// RUN: %clang_cc1 -triple i386-unknown-linux-gnu -w -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,cplusplus.NewDelete -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -w -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,cplusplus.NewDelete -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple i386-unknown-linux-gnu -w -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,cplusplus.NewDelete -analyzer-store=region -verify %s #include "Inputs/system-header-simulator-cxx.h" Index: test/Analysis/malloc.m =================================================================== --- test/Analysis/malloc.m +++ test/Analysis/malloc.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify -Wno-objc-root-class -fblocks %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify -Wno-objc-root-class -fblocks %s #include "Inputs/system-header-simulator-objc.h" @class NSString; Index: test/Analysis/malloc.mm =================================================================== --- test/Analysis/malloc.mm +++ test/Analysis/malloc.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify -fblocks %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify -fblocks %s #import "Inputs/system-header-simulator-objc.h" #import "Inputs/system-header-simulator-for-malloc.h" Index: test/Analysis/max-nodes-suppress-on-sink.c =================================================================== --- test/Analysis/max-nodes-suppress-on-sink.c +++ test/Analysis/max-nodes-suppress-on-sink.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config max-nodes=12 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config max-nodes=12 -verify %s // Here we test how "suppress on sink" feature of certain bugtypes interacts // with reaching analysis limits. Index: test/Analysis/member-expr.cpp =================================================================== --- test/Analysis/member-expr.cpp +++ test/Analysis/member-expr.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection %s -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection %s -verify void clang_analyzer_checkInlined(bool); void clang_analyzer_eval(int); Index: test/Analysis/method-arg-decay.m =================================================================== --- test/Analysis/method-arg-decay.m +++ test/Analysis/method-arg-decay.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyzer-checker=core -verify %s -Wno-incomplete-implementation +// RUN: %clang_cc1 %z3_cc1 -analyzer-checker=core -verify %s -Wno-incomplete-implementation typedef signed char BOOL; typedef int NSInteger; typedef unsigned int NSUInteger; Index: test/Analysis/method-call-intra-p.cpp =================================================================== --- test/Analysis/method-call-intra-p.cpp +++ test/Analysis/method-call-intra-p.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store region -verify %s // expected-no-diagnostics // Intra-procedural C++ tests. Index: test/Analysis/method-call-path-notes.cpp =================================================================== --- test/Analysis/method-call-path-notes.cpp +++ test/Analysis/method-call-path-notes.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s // Test warning about null or uninitialized pointer values used as instance member Index: test/Analysis/method-call.cpp =================================================================== --- test/Analysis/method-call.cpp +++ test/Analysis/method-call.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-inlining=constructors -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-inlining=constructors -verify %s void clang_analyzer_eval(bool); Index: test/Analysis/misc-ps-64.m =================================================================== --- test/Analysis/misc-ps-64.m +++ test/Analysis/misc-ps-64.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s // expected-no-diagnostics // - A bunch of misc. failures involving evaluating Index: test/Analysis/misc-ps-arm.m =================================================================== --- test/Analysis/misc-ps-arm.m +++ test/Analysis/misc-ps-arm.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple thumbv7-apple-ios0.0.0 -target-feature +neon -analyze -analyzer-checker=core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -triple thumbv7-apple-ios0.0.0 -target-feature +neon -analyze -analyzer-checker=core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class %s // expected-no-diagnostics // - Handle casts of vectors to structs, and loading Index: test/Analysis/misc-ps-cxx0x.cpp =================================================================== --- test/Analysis/misc-ps-cxx0x.cpp +++ test/Analysis/misc-ps-cxx0x.cpp @@ -1,4 +1,4 @@ -// RUN: %clang --analyze -std=c++11 %s -Xclang -verify -o /dev/null +// RUN: %clang %z3 --analyze -std=c++11 %s -Xclang -verify -o /dev/null void test_static_assert() { static_assert(sizeof(void *) == sizeof(void*), "test_static_assert"); Index: test/Analysis/misc-ps-eager-assume.m =================================================================== --- test/Analysis/misc-ps-eager-assume.m +++ test/Analysis/misc-ps-eager-assume.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s -analyzer-eagerly-assume +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s -analyzer-eagerly-assume // expected-no-diagnostics // Delta-reduced header stuff (needed for test cases). Index: test/Analysis/misc-ps-ranges.m =================================================================== --- test/Analysis/misc-ps-ranges.m +++ test/Analysis/misc-ps-ranges.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s // // main's 'argc' argument is always > 0 Index: test/Analysis/misc-ps-region-store-i386.m =================================================================== --- test/Analysis/misc-ps-region-store-i386.m +++ test/Analysis/misc-ps-region-store-i386.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s // expected-no-diagnostics // Here is a case where a pointer is treated as integer, invalidated as an Index: test/Analysis/misc-ps-region-store-x86_64.m =================================================================== --- test/Analysis/misc-ps-region-store-x86_64.m +++ test/Analysis/misc-ps-region-store-x86_64.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s // expected-no-diagnostics // Here is a case where a pointer is treated as integer, invalidated as an Index: test/Analysis/misc-ps-region-store.cpp =================================================================== --- test/Analysis/misc-ps-region-store.cpp +++ test/Analysis/misc-ps-region-store.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -fexceptions -fcxx-exceptions -Wno-tautological-undefined-compare -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -fexceptions -fcxx-exceptions -Wno-tautological-undefined-compare +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -fexceptions -fcxx-exceptions -Wno-tautological-undefined-compare +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -fexceptions -fcxx-exceptions -Wno-tautological-undefined-compare void clang_analyzer_warnIfReached(); Index: test/Analysis/misc-ps-region-store.m =================================================================== --- test/Analysis/misc-ps-region-store.m +++ test/Analysis/misc-ps-region-store.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core.CastToStruct,alpha.security.ReturnPtrRange,alpha.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -DTEST_64 -analyze -analyzer-checker=core,alpha.core.CastToStruct,alpha.security.ReturnPtrRange,alpha.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core.CastToStruct,alpha.security.ReturnPtrRange,alpha.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin9 -DTEST_64 -analyze -analyzer-checker=core,alpha.core.CastToStruct,alpha.security.ReturnPtrRange,alpha.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class %s typedef long unsigned int size_t; void *memcpy(void *, const void *, size_t); Index: test/Analysis/misc-ps-region-store.mm =================================================================== --- test/Analysis/misc-ps-region-store.mm +++ test/Analysis/misc-ps-region-store.mm @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s // expected-no-diagnostics //===------------------------------------------------------------------------------------------===// Index: test/Analysis/misc-ps.c =================================================================== --- test/Analysis/misc-ps.c +++ test/Analysis/misc-ps.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -disable-free -analyzer-eagerly-assume -analyzer-checker=core,deadcode,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -disable-free -analyzer-eagerly-assume -analyzer-checker=core,deadcode,debug.ExprInspection -verify %s void clang_analyzer_eval(int); Index: test/Analysis/misc-ps.m =================================================================== --- test/Analysis/misc-ps.m +++ test/Analysis/misc-ps.m @@ -1,6 +1,6 @@ // 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,alpha.core,osx.cocoa.AtSync -analyzer-store=region -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -analyzer-store=region -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -analyzer-store=region -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -analyzer-store=region -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s #ifndef __clang_analyzer__ #error __clang_analyzer__ not defined Index: test/Analysis/model-file.cpp =================================================================== --- test/Analysis/model-file.cpp +++ test/Analysis/model-file.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-config faux-bodies=true,model-path=%S/Inputs/Models -analyzer-output=plist-multi-file -verify %s -o %t +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-config faux-bodies=true,model-path=%S/Inputs/Models -analyzer-output=plist-multi-file -verify %s -o %t // RUN: FileCheck --input-file=%t %s typedef int* intptr; Index: test/Analysis/mpichecker.cpp =================================================================== --- test/Analysis/mpichecker.cpp +++ test/Analysis/mpichecker.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=optin.mpi.MPI-Checker -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=optin.mpi.MPI-Checker -verify %s #include "MPIMock.h" Index: test/Analysis/mpicheckernotes.cpp =================================================================== --- test/Analysis/mpicheckernotes.cpp +++ test/Analysis/mpicheckernotes.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=optin.mpi.MPI-Checker -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=optin.mpi.MPI-Checker -analyzer-output=text -verify %s // MPI-Checker test file to test note diagnostics. Index: test/Analysis/new-with-exceptions.cpp =================================================================== --- test/Analysis/new-with-exceptions.cpp +++ test/Analysis/new-with-exceptions.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store region -std=c++11 -fexceptions -fcxx-exceptions -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store region -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store region -std=c++11 -fexceptions -fcxx-exceptions -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store region -std=c++11 -verify %s void clang_analyzer_eval(bool); Index: test/Analysis/new.cpp =================================================================== --- test/Analysis/new.cpp +++ test/Analysis/new.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-store region -std=c++11 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-store region -std=c++11 -verify %s #include "Inputs/system-header-simulator-cxx.h" void clang_analyzer_eval(bool); Index: test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m =================================================================== --- test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m +++ test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret-region.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin8 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin8 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s // - This test case shows that a nil instance // variable can possibly be initialized by a method. Index: test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m =================================================================== --- test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m +++ test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m @@ -1,8 +1,8 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin8 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-objc-root-class %s > %t.1 2>&1 +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin8 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-objc-root-class %s > %t.1 2>&1 // RUN: FileCheck -input-file=%t.1 -check-prefix=CHECK-darwin8 %s -// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-objc-root-class %s > %t.2 2>&1 +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-objc-root-class %s > %t.2 2>&1 // RUN: FileCheck -input-file=%t.2 -check-prefix=CHECK-darwin9 %s -// RUN: %clang_cc1 -triple thumbv6-apple-ios4.0 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-objc-root-class %s > %t.3 2>&1 +// RUN: %clang_cc1 %z3_cc1 -triple thumbv6-apple-ios4.0 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-objc-root-class %s > %t.3 2>&1 // RUN: FileCheck -input-file=%t.3 -check-prefix=CHECK-darwin9 %s @interface MyClass {} Index: test/Analysis/no-exit-cfg.c =================================================================== --- test/Analysis/no-exit-cfg.c +++ test/Analysis/no-exit-cfg.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s // expected-no-diagnostics // This is a test case for the issue reported in PR 2819: Index: test/Analysis/no-outofbounds.c =================================================================== --- test/Analysis/no-outofbounds.c +++ test/Analysis/no-outofbounds.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,alpha.unix,alpha.security.ArrayBound -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core,alpha.unix,alpha.security.ArrayBound -analyzer-store=region -verify %s // expected-no-diagnostics //===----------------------------------------------------------------------===// Index: test/Analysis/no-unreachable-dtors.cpp =================================================================== --- test/Analysis/no-unreachable-dtors.cpp +++ test/Analysis/no-unreachable-dtors.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=debug.Stats -verify -Wno-unreachable-code %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.Stats -verify -Wno-unreachable-code %s struct S { ~S(); Index: test/Analysis/non-diagnosable-assumptions.c =================================================================== --- test/Analysis/non-diagnosable-assumptions.c +++ test/Analysis/non-diagnosable-assumptions.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -w -analyze -analyzer-checker=core.DivideZero -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -w -analyze -analyzer-checker=core.DivideZero -analyzer-output=text -verify %s // This test file verifies the "Assuming..." diagnostic pieces that are being // reported when the branch condition was too complicated to explain. Index: test/Analysis/nonnull.m =================================================================== --- test/Analysis/nonnull.m +++ test/Analysis/nonnull.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -w -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -w -verify %s @interface MyObject - (void)takePointer:(void *)ptr __attribute__((nonnull(1))); Index: test/Analysis/null-deref-path-notes.m =================================================================== --- test/Analysis/null-deref-path-notes.m +++ test/Analysis/null-deref-path-notes.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-output=text -fblocks -verify -Wno-objc-root-class %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false -fblocks -Wno-objc-root-class %s -o %t +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-output=text -fblocks -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false -fblocks -Wno-objc-root-class %s -o %t // RUN: FileCheck --input-file=%t %s @interface Root { Index: test/Analysis/null-deref-ps-region.c =================================================================== --- test/Analysis/null-deref-ps-region.c +++ test/Analysis/null-deref-ps-region.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -std=gnu99 -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -std=gnu99 -analyzer-store=region -verify %s // expected-no-diagnostics Index: test/Analysis/null-deref-ps.c =================================================================== --- test/Analysis/null-deref-ps.c +++ test/Analysis/null-deref-ps.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,alpha.core -std=gnu99 -analyzer-store=region -analyzer-purge=none -verify %s -Wno-error=return-type -// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,alpha.core -std=gnu99 -analyzer-store=region -verify %s -Wno-error=return-type +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,alpha.core -std=gnu99 -analyzer-store=region -analyzer-purge=none -verify %s -Wno-error=return-type +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,alpha.core -std=gnu99 -analyzer-store=region -verify %s -Wno-error=return-type typedef unsigned uintptr_t; Index: test/Analysis/nullability-no-arc.mm =================================================================== --- test/Analysis/nullability-no-arc.mm +++ test/Analysis/nullability-no-arc.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,nullability -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,nullability -verify %s #define nil 0 Index: test/Analysis/nullability.c =================================================================== --- test/Analysis/nullability.c +++ test/Analysis/nullability.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fblocks -analyze -analyzer-checker=core,nullability -verify %s +// RUN: %clang_cc1 %z3_cc1 -fblocks -analyze -analyzer-checker=core,nullability -verify %s void it_takes_two(int a, int b); void function_pointer_arity_mismatch() { Index: test/Analysis/nullability.mm =================================================================== --- test/Analysis/nullability.mm +++ test/Analysis/nullability.mm @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -fblocks -analyze -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullableDereferenced -DNOSYSTEMHEADERS=0 -verify %s -// RUN: %clang_cc1 -fblocks -analyze -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullableDereferenced -analyzer-config nullability:NoDiagnoseCallsToSystemHeaders=true -DNOSYSTEMHEADERS=1 -verify %s +// RUN: %clang_cc1 %z3_cc1 -fblocks -analyze -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullableDereferenced -DNOSYSTEMHEADERS=0 -verify %s +// RUN: %clang_cc1 %z3_cc1 -fblocks -analyze -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullableDereferenced -analyzer-config nullability:NoDiagnoseCallsToSystemHeaders=true -DNOSYSTEMHEADERS=1 -verify %s #include "Inputs/system-header-simulator-for-nullability.h" Index: test/Analysis/nullability_nullonly.mm =================================================================== --- test/Analysis/nullability_nullonly.mm +++ test/Analysis/nullability_nullonly.mm @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -fobjc-arc -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull -DNOSYSTEMHEADERS=0 -verify %s -// RUN: %clang_cc1 -analyze -fobjc-arc -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull -analyzer-config nullability:NoDiagnoseCallsToSystemHeaders=true -DNOSYSTEMHEADERS=1 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -fobjc-arc -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull -DNOSYSTEMHEADERS=0 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -fobjc-arc -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull -analyzer-config nullability:NoDiagnoseCallsToSystemHeaders=true -DNOSYSTEMHEADERS=1 -verify %s #include "Inputs/system-header-simulator-for-nullability.h" Index: test/Analysis/nullptr.cpp =================================================================== --- test/Analysis/nullptr.cpp +++ test/Analysis/nullptr.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -Wno-conversion-null -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store region -verify %s +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -Wno-conversion-null -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store region -verify %s void clang_analyzer_eval(int); Index: test/Analysis/number-object-conversion.c =================================================================== --- test/Analysis/number-object-conversion.c +++ test/Analysis/number-object-conversion.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin10 -w -analyze -analyzer-checker=osx.NumberObjectConversion %s -verify -// RUN: %clang_cc1 -triple i386-apple-darwin10 -w -analyze -analyzer-checker=osx.NumberObjectConversion -analyzer-config osx.NumberObjectConversion:Pedantic=true -DPEDANTIC %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -w -analyze -analyzer-checker=osx.NumberObjectConversion %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -w -analyze -analyzer-checker=osx.NumberObjectConversion -analyzer-config osx.NumberObjectConversion:Pedantic=true -DPEDANTIC %s -verify #define NULL ((void *)0) Index: test/Analysis/number-object-conversion.cpp =================================================================== --- test/Analysis/number-object-conversion.cpp +++ test/Analysis/number-object-conversion.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin10 -w -std=c++11 -analyze -analyzer-checker=osx.NumberObjectConversion %s -verify -// RUN: %clang_cc1 -triple i386-apple-darwin10 -w -std=c++11 -analyze -analyzer-checker=osx.NumberObjectConversion -analyzer-config osx.NumberObjectConversion:Pedantic=true -DPEDANTIC %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -w -std=c++11 -analyze -analyzer-checker=osx.NumberObjectConversion %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -w -std=c++11 -analyze -analyzer-checker=osx.NumberObjectConversion -analyzer-config osx.NumberObjectConversion:Pedantic=true -DPEDANTIC %s -verify #define NULL ((void *)0) #include "Inputs/system-header-simulator-cxx.h" // for nullptr Index: test/Analysis/number-object-conversion.m =================================================================== --- test/Analysis/number-object-conversion.m +++ test/Analysis/number-object-conversion.m @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin10 -fblocks -w -analyze -analyzer-checker=osx.NumberObjectConversion %s -verify -// RUN: %clang_cc1 -triple i386-apple-darwin10 -fblocks -w -analyze -analyzer-checker=osx.NumberObjectConversion -analyzer-config osx.NumberObjectConversion:Pedantic=true -DPEDANTIC %s -verify -// RUN: %clang_cc1 -triple i386-apple-darwin10 -fblocks -fobjc-arc -w -analyze -analyzer-checker=osx.NumberObjectConversion %s -verify -// RUN: %clang_cc1 -triple i386-apple-darwin10 -fblocks -fobjc-arc -w -analyze -analyzer-checker=osx.NumberObjectConversion -analyzer-config osx.NumberObjectConversion:Pedantic=true -DPEDANTIC %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -fblocks -w -analyze -analyzer-checker=osx.NumberObjectConversion %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -fblocks -w -analyze -analyzer-checker=osx.NumberObjectConversion -analyzer-config osx.NumberObjectConversion:Pedantic=true -DPEDANTIC %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -fblocks -fobjc-arc -w -analyze -analyzer-checker=osx.NumberObjectConversion %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -fblocks -fobjc-arc -w -analyze -analyzer-checker=osx.NumberObjectConversion -analyzer-config osx.NumberObjectConversion:Pedantic=true -DPEDANTIC %s -verify #include "Inputs/system-header-simulator-objc.h" Index: test/Analysis/objc-arc.m =================================================================== --- test/Analysis/objc-arc.m +++ test/Analysis/objc-arc.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,deadcode -verify -fblocks -analyzer-opt-analyze-nested-blocks -fobjc-arc -analyzer-config path-diagnostics-alternate=true -analyzer-output=plist-multi-file -o %t.plist %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,deadcode -verify -fblocks -analyzer-opt-analyze-nested-blocks -fobjc-arc -analyzer-config path-diagnostics-alternate=true -analyzer-output=plist-multi-file -o %t.plist %s // RUN: FileCheck --input-file=%t.plist %s typedef signed char BOOL; Index: test/Analysis/objc-bool.m =================================================================== --- test/Analysis/objc-bool.m +++ test/Analysis/objc-bool.m @@ -1,4 +1,4 @@ -// RUN: %clang --analyze %s -o %t -Xclang -verify +// RUN: %clang %z3 --analyze %s -o %t -Xclang -verify // expected-no-diagnostics // Test handling of ObjC bool literals. Index: test/Analysis/objc-boxing.m =================================================================== --- test/Analysis/objc-boxing.m +++ test/Analysis/objc-boxing.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-objc-literal-conversion -analyze -analyzer-checker=core,unix.Malloc,osx.cocoa.NonNilReturnValue,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -Wno-objc-literal-conversion -analyze -analyzer-checker=core,unix.Malloc,osx.cocoa.NonNilReturnValue,debug.ExprInspection -analyzer-store=region -verify %s void clang_analyzer_eval(int); Index: test/Analysis/objc-for.m =================================================================== --- test/Analysis/objc-for.m +++ test/Analysis/objc-for.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.Loops,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.Loops,debug.ExprInspection -verify %s void clang_analyzer_eval(int); Index: test/Analysis/objc-message.m =================================================================== --- test/Analysis/objc-message.m +++ test/Analysis/objc-message.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class %s extern void clang_analyzer_warnIfReached(); void clang_analyzer_eval(int); Index: test/Analysis/objc-method-coverage.m =================================================================== --- test/Analysis/objc-method-coverage.m +++ test/Analysis/objc-method-coverage.m @@ -1,5 +1,5 @@ // REQUIRES: asserts -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-stats -fblocks %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-stats -fblocks %s 2>&1 | FileCheck %s @interface I int f() { return 0; Index: test/Analysis/objc-properties.m =================================================================== --- test/Analysis/objc-properties.m +++ test/Analysis/objc-properties.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.osx.cocoa.DirectIvarAssignment -verify -fblocks %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.osx.cocoa.DirectIvarAssignment -verify -fblocks %s typedef signed char BOOL; @protocol NSObject - (BOOL)isEqual:(id)object; @end Index: test/Analysis/objc-radar17039661.m =================================================================== --- test/Analysis/objc-radar17039661.m +++ test/Analysis/objc-radar17039661.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -fblocks -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -fblocks -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -fblocks -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t // RUN: FileCheck --input-file=%t %s @class NSString; typedef long NSInteger; Index: test/Analysis/objc-string.mm =================================================================== --- test/Analysis/objc-string.mm +++ test/Analysis/objc-string.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify -Wno-objc-literal-conversion %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify -Wno-objc-literal-conversion %s void clang_analyzer_eval(bool); @class NSString; Index: test/Analysis/objc-subscript.m =================================================================== --- test/Analysis/objc-subscript.m +++ test/Analysis/objc-subscript.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify -Wno-objc-root-class %s typedef signed char BOOL; typedef unsigned int NSUInteger; Index: test/Analysis/objc/direct-ivar-assignment-in-annotated-functions.m =================================================================== --- test/Analysis/objc/direct-ivar-assignment-in-annotated-functions.m +++ test/Analysis/objc/direct-ivar-assignment-in-annotated-functions.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.osx.cocoa.DirectIvarAssignmentForAnnotatedFunctions -verify -fblocks %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.osx.cocoa.DirectIvarAssignmentForAnnotatedFunctions -verify -fblocks %s typedef signed char BOOL; @protocol NSObject - (BOOL)isEqual:(id)object; @end Index: test/Analysis/objc_invalidation.m =================================================================== --- test/Analysis/objc_invalidation.m +++ test/Analysis/objc_invalidation.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.osx.cocoa.InstanceVariableInvalidation -DRUN_IVAR_INVALIDATION -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.osx.cocoa.MissingInvalidationMethod -DRUN_MISSING_INVALIDATION_METHOD -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.osx.cocoa.InstanceVariableInvalidation -DRUN_IVAR_INVALIDATION -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.osx.cocoa.MissingInvalidationMethod -DRUN_MISSING_INVALIDATION_METHOD -verify %s extern void __assert_fail (__const char *__assertion, __const char *__file, unsigned int __line, __const char *__function) __attribute__ ((__noreturn__)); Index: test/Analysis/operator-calls.cpp =================================================================== --- test/Analysis/operator-calls.cpp +++ test/Analysis/operator-calls.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -verify %s void clang_analyzer_eval(bool); struct X0 { }; Index: test/Analysis/out-of-bounds-new.cpp =================================================================== --- test/Analysis/out-of-bounds-new.cpp +++ test/Analysis/out-of-bounds-new.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -Wno-array-bounds -analyze -analyzer-checker=unix,core,alpha.security.ArrayBoundV2 -verify %s +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -Wno-array-bounds -analyze -analyzer-checker=unix,core,alpha.security.ArrayBoundV2 -verify %s // Tests doing an out-of-bounds access after the end of an array using: // - constant integer index Index: test/Analysis/out-of-bounds.c =================================================================== --- test/Analysis/out-of-bounds.c +++ test/Analysis/out-of-bounds.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,alpha.security.ArrayBoundV2,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,alpha.security.ArrayBoundV2,debug.ExprInspection -verify %s void clang_analyzer_eval(int); Index: test/Analysis/outofbound-notwork.c =================================================================== --- test/Analysis/outofbound-notwork.c +++ test/Analysis/outofbound-notwork.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,alpha.security.ArrayBound -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,alpha.security.ArrayBound -analyzer-store=region -verify %s // XFAIL: * // Once we better handle modeling of sizes of VLAs, we can pull this back Index: test/Analysis/outofbound.c =================================================================== --- test/Analysis/outofbound.c +++ test/Analysis/outofbound.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,unix,alpha.security.ArrayBound -analyzer-store=region -verify -analyzer-config unix:Optimistic=true %s +// RUN: %clang_cc1 %z3_cc1 -Wno-array-bounds -analyze -analyzer-checker=core,unix,alpha.security.ArrayBound -analyzer-store=region -verify -analyzer-config unix:Optimistic=true %s typedef __typeof(sizeof(int)) size_t; void *malloc(size_t); Index: test/Analysis/override-werror.c =================================================================== --- test/Analysis/override-werror.c +++ test/Analysis/override-werror.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -Werror %s -analyzer-store=region -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -Werror %s -analyzer-store=region -verify // This test case illustrates that using '-analyze' overrides the effect of // -Werror. This allows basic warnings not to interfere with producing Index: test/Analysis/padding_c.c =================================================================== --- test/Analysis/padding_c.c +++ test/Analysis/padding_c.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=optin.performance -analyzer-config optin.performance.Padding:AllowedPad=2 -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=optin.performance -analyzer-config optin.performance.Padding:AllowedPad=2 -verify %s #if __has_include() #include Index: test/Analysis/padding_cpp.cpp =================================================================== --- test/Analysis/padding_cpp.cpp +++ test/Analysis/padding_cpp.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++14 -analyze -analyzer-checker=optin.performance -analyzer-config optin.performance.Padding:AllowedPad=2 -verify %s +// RUN: %clang_cc1 %z3_cc1 -std=c++14 -analyze -analyzer-checker=optin.performance -analyzer-config optin.performance.Padding:AllowedPad=2 -verify %s // Make sure that the C cases still work fine, even when compiled as C++. #include "padding_c.c" Index: test/Analysis/padding_message.cpp =================================================================== --- test/Analysis/padding_message.cpp +++ test/Analysis/padding_message.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-linux -std=c++14 -analyze -analyzer-checker=optin.performance -analyzer-config optin.performance.Padding:AllowedPad=2 -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-unknown-linux -std=c++14 -analyze -analyzer-checker=optin.performance -analyzer-config optin.performance.Padding:AllowedPad=2 -verify %s // expected-warning@+7{{\ Excessive padding in 'struct IntSandwich' (6 padding bytes, where 2 is optimal). \ Index: test/Analysis/plist-html-macros.c =================================================================== --- test/Analysis/plist-html-macros.c +++ test/Analysis/plist-html-macros.c @@ -1,9 +1,9 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify %s // (sanity check) // RUN: rm -rf %t.dir // RUN: mkdir -p %t.dir -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-html -o %t.dir/index.plist %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-html -o %t.dir/index.plist %s // RUN: ls %t.dir | grep '\.html' | count 1 // RUN: grep '\.html' %t.dir/index.plist | count 1 Index: test/Analysis/plist-macros.cpp =================================================================== --- test/Analysis/plist-macros.cpp +++ test/Analysis/plist-macros.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -analyzer-eagerly-assume -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -analyzer-eagerly-assume -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=ture %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix -analyzer-eagerly-assume -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix -analyzer-eagerly-assume -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=ture %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s Index: test/Analysis/plist-output-alternate.m =================================================================== --- test/Analysis/plist-output-alternate.m +++ test/Analysis/plist-output-alternate.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -fblocks -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false -o %t %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -fblocks -analyzer-output=plist -analyzer-config path-diagnostics-alternate=false -o %t %s // RUN: FileCheck --input-file %t %s void test_null_init(void) { Index: test/Analysis/plist-output.m =================================================================== --- test/Analysis/plist-output.m +++ test/Analysis/plist-output.m @@ -1,4 +1,4 @@ -// RUN: %clang --analyze %s -Xanalyzer -analyzer-checker=osx.cocoa.RetainCount -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -o %t.plist +// RUN: %clang %z3 --analyze %s -Xanalyzer -analyzer-checker=osx.cocoa.RetainCount -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -Xanalyzer -analyzer-config -Xanalyzer path-diagnostics-alternate=false -o %t.plist // RUN: FileCheck --input-file=%t.plist %s void test_null_init(void) { Index: test/Analysis/pointer-to-member.cpp =================================================================== --- test/Analysis/pointer-to-member.cpp +++ test/Analysis/pointer-to-member.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s void clang_analyzer_eval(bool); Index: test/Analysis/pr22954.c =================================================================== --- test/Analysis/pr22954.c +++ test/Analysis/pr22954.c @@ -3,7 +3,7 @@ // At the moment the whole of the destination array content is invalidated. // If a.s1 region has a symbolic offset, the whole region of 'a' is invalidated. // Specific triple set to test structures of size 0. -// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-pc-linux-gnu -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-store=region -verify %s typedef __typeof(sizeof(int)) size_t; Index: test/Analysis/pr4209.m =================================================================== --- test/Analysis/pr4209.m +++ test/Analysis/pr4209.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-incomplete-implementation -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -Wno-incomplete-implementation -verify %s // This test case was crashing due to how CFRefCount.cpp resolved the // ObjCInterfaceDecl* and ClassName in EvalObjCMessageExpr. Index: test/Analysis/pr_2542_rdar_6793404.m =================================================================== --- test/Analysis/pr_2542_rdar_6793404.m +++ test/Analysis/pr_2542_rdar_6793404.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -pedantic -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -pedantic -analyzer-store=region -verify -Wno-objc-root-class %s // BEGIN delta-debugging reduced header stuff Index: test/Analysis/pr_4164.c =================================================================== --- test/Analysis/pr_4164.c +++ test/Analysis/pr_4164.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s // expected-no-diagnostics // PR 4164: http://llvm.org/bugs/show_bug.cgi?id=4164 Index: test/Analysis/properties.m =================================================================== --- test/Analysis/properties.m +++ test/Analysis/properties.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,osx.cocoa.Dealloc,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,osx.cocoa.Dealloc,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class -fobjc-arc %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,osx.cocoa.Dealloc,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,osx.cocoa.Dealloc,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class -fobjc-arc %s void clang_analyzer_eval(int); Index: test/Analysis/properties.mm =================================================================== --- test/Analysis/properties.mm +++ test/Analysis/properties.mm @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class -fobjc-arc %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,debug.ExprInspection -analyzer-store=region -verify -Wno-objc-root-class -fobjc-arc %s void clang_analyzer_eval(bool); void clang_analyzer_checkInlined(bool); Index: test/Analysis/pthreadlock.c =================================================================== --- test/Analysis/pthreadlock.c +++ test/Analysis/pthreadlock.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.unix.PthreadLock -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.unix.PthreadLock -verify %s // Tests performing normal locking patterns and wrong locking orders Index: test/Analysis/ptr-arith.c =================================================================== --- test/Analysis/ptr-arith.c +++ test/Analysis/ptr-arith.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,debug.ExprInspection -analyzer-store=region -verify -triple x86_64-apple-darwin9 -Wno-tautological-pointer-compare %s -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,debug.ExprInspection -analyzer-store=region -verify -triple i686-apple-darwin9 -Wno-tautological-pointer-compare %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,debug.ExprInspection -analyzer-store=region -verify -triple x86_64-apple-darwin9 -Wno-tautological-pointer-compare %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,debug.ExprInspection -analyzer-store=region -verify -triple i686-apple-darwin9 -Wno-tautological-pointer-compare %s void clang_analyzer_eval(int); @@ -255,30 +255,24 @@ void zero_implies_reversed_equal(int *lhs, int *rhs) { clang_analyzer_eval((rhs - lhs) == 0); // expected-warning{{UNKNOWN}} if ((rhs - lhs) == 0) { - // FIXME: Should be FALSE. - clang_analyzer_eval(rhs != lhs); // expected-warning{{UNKNOWN}} - // FIXME: Should be TRUE. - clang_analyzer_eval(rhs == lhs); // expected-warning{{UNKNOWN}} + clang_analyzer_eval(rhs != lhs); // expected-warning{{FALSE}} + clang_analyzer_eval(rhs == lhs); // expected-warning{{TRUE}} return; } clang_analyzer_eval((rhs - lhs) == 0); // expected-warning{{FALSE}} - // FIXME: Should be FALSE. - clang_analyzer_eval(rhs == lhs); // expected-warning{{UNKNOWN}} - // FIXME: Should be TRUE. - clang_analyzer_eval(rhs != lhs); // expected-warning{{UNKNOWN}} + clang_analyzer_eval(rhs == lhs); // expected-warning{{FALSE}} + clang_analyzer_eval(rhs != lhs); // expected-warning{{TRUE}} } void canonical_equal(int *lhs, int *rhs) { clang_analyzer_eval(lhs == rhs); // expected-warning{{UNKNOWN}} if (lhs == rhs) { - // FIXME: Should be TRUE. - clang_analyzer_eval(rhs == lhs); // expected-warning{{UNKNOWN}} + clang_analyzer_eval(rhs == lhs); // expected-warning{{TRUE}} return; } clang_analyzer_eval(lhs == rhs); // expected-warning{{FALSE}} - // FIXME: Should be FALSE. - clang_analyzer_eval(rhs == lhs); // expected-warning{{UNKNOWN}} + clang_analyzer_eval(rhs == lhs); // expected-warning{{FALSE}} } void compare_element_region_and_base(int *p) { Index: test/Analysis/ptr-arith.cpp =================================================================== --- test/Analysis/ptr-arith.cpp +++ test/Analysis/ptr-arith.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-unused-value -std=c++14 -analyze -analyzer-checker=core,debug.ExprInspection,alpha.core.PointerArithm -verify %s +// RUN: %clang_cc1 %z3_cc1 -Wno-unused-value -std=c++14 -analyze -analyzer-checker=core,debug.ExprInspection,alpha.core.PointerArithm -verify %s struct X { int *p; int zero; Index: test/Analysis/qt_malloc.cpp =================================================================== --- test/Analysis/qt_malloc.cpp +++ test/Analysis/qt_malloc.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,cplusplus -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,cplusplus -analyzer-store=region -verify %s // expected-no-diagnostics #include "Inputs/qt-simulator.h" Index: test/Analysis/range_casts.c =================================================================== --- test/Analysis/range_casts.c +++ test/Analysis/range_casts.c @@ -1,5 +1,5 @@ // This test checks that intersecting ranges does not cause 'system is over constrained' assertions in the case of eg: 32 bits unsigned integers getting their range from 64 bits signed integers. -// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-pc-linux-gnu -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store=region -verify %s void clang_analyzer_warnIfReached(); Index: test/Analysis/rdar-6442306-1.m =================================================================== --- test/Analysis/rdar-6442306-1.m +++ test/Analysis/rdar-6442306-1.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-disable-checker=alpha.core.PointerArithm %s -analyzer-store=region -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-disable-checker=alpha.core.PointerArithm %s -analyzer-store=region -verify // expected-no-diagnostics typedef int bar_return_t; Index: test/Analysis/rdar-6540084.m =================================================================== --- test/Analysis/rdar-6540084.m +++ test/Analysis/rdar-6540084.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-checker=deadcode.DeadStores -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-checker=deadcode.DeadStores -verify %s // // This test exercises the live variables analysis (LiveVariables.cpp). // The case originally identified a non-termination bug. Index: test/Analysis/rdar-6541136-region.c =================================================================== --- test/Analysis/rdar-6541136-region.c +++ test/Analysis/rdar-6541136-region.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -verify -analyze -analyzer-checker=core,alpha.security.ArrayBound -analyzer-store=region %s +// RUN: %clang_cc1 %z3_cc1 -verify -analyze -analyzer-checker=core,alpha.security.ArrayBound -analyzer-store=region %s struct tea_cheese { unsigned magic; }; typedef struct tea_cheese kernel_tea_cheese_t; Index: test/Analysis/rdar-6562655.m =================================================================== --- test/Analysis/rdar-6562655.m +++ test/Analysis/rdar-6562655.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -verify %s // expected-no-diagnostics // // This test case mainly checks that the retain/release checker doesn't crash Index: test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m =================================================================== --- test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m +++ test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -Wno-objc-root-class %s // expected-no-diagnostics typedef struct Foo { int x; } Bar; Index: test/Analysis/rdar-7168531.m =================================================================== --- test/Analysis/rdar-7168531.m +++ test/Analysis/rdar-7168531.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -triple i386-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -analyzer-store=region %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -triple i386-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -analyzer-store=region %s // Note that the target triple is important for this test case. It specifies that we use the // fragile Objective-C ABI. Index: test/Analysis/redefined_system.c =================================================================== --- test/Analysis/redefined_system.c +++ test/Analysis/redefined_system.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=osx,unix,core,alpha.security.taint -w -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=osx,unix,core,alpha.security.taint -w -verify %s // expected-no-diagnostics // Make sure we don't crash when someone redefines a system function we reason about. Index: test/Analysis/refcnt_naming.m =================================================================== --- test/Analysis/refcnt_naming.m +++ test/Analysis/refcnt_naming.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-config ipa=none -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-config ipa=none -analyzer-store=region -verify %s typedef const struct __CFString * CFStringRef; typedef const struct __CFAllocator * CFAllocatorRef; Index: test/Analysis/reference.cpp =================================================================== --- test/Analysis/reference.cpp +++ test/Analysis/reference.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -Wno-null-dereference -Wno-tautological-undefined-compare %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -Wno-null-dereference -Wno-tautological-undefined-compare %s void clang_analyzer_eval(bool); Index: test/Analysis/reference.mm =================================================================== --- test/Analysis/reference.mm +++ test/Analysis/reference.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -Wno-null-dereference %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify -Wno-null-dereference %s @interface Foo - (int &)ref; Index: test/Analysis/region-1.m =================================================================== --- test/Analysis/region-1.m +++ test/Analysis/region-1.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s // expected-no-diagnostics // // This test case simply should not crash. It evaluates the logic of not Index: test/Analysis/region-store.c =================================================================== --- test/Analysis/region-store.c +++ test/Analysis/region-store.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix,debug.ExprInspection -verify %s int printf(const char *restrict,...); Index: test/Analysis/region-store.cpp =================================================================== --- test/Analysis/region-store.cpp +++ test/Analysis/region-store.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix -verify %s // expected-no-diagnostics class Loc { Index: test/Analysis/reinterpret-cast.cpp =================================================================== --- test/Analysis/reinterpret-cast.cpp +++ test/Analysis/reinterpret-cast.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s void clang_analyzer_eval(bool); Index: test/Analysis/retain-release-arc.m =================================================================== --- test/Analysis/retain-release-arc.m +++ test/Analysis/retain-release-arc.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -fobjc-arc -fblocks -verify -Wno-objc-root-class %s -analyzer-output=text -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -fblocks -verify -Wno-objc-root-class %s -analyzer-output=text +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -fobjc-arc -fblocks -verify -Wno-objc-root-class %s -analyzer-output=text +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -fblocks -verify -Wno-objc-root-class %s -analyzer-output=text typedef __typeof(sizeof(int)) size_t; Index: test/Analysis/retain-release-cache-out.m =================================================================== --- test/Analysis/retain-release-cache-out.m +++ test/Analysis/retain-release-cache-out.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze %s -analyzer-checker=core,osx.cocoa.RetainCount -fblocks -verify +// RUN: %clang_cc1 %z3_cc1 -analyze %s -analyzer-checker=core,osx.cocoa.RetainCount -fblocks -verify // This test is checking behavior when a single checker runs only with the core // checkers, testing that the traversal order in the CFG does not affect the Index: test/Analysis/retain-release-cf-audited.m =================================================================== --- test/Analysis/retain-release-cf-audited.m +++ test/Analysis/retain-release-cf-audited.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -verify %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -verify %s -x objective-c++ +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -verify %s -x objective-c++ // The special thing about this file is that CFRetain and CFRelease are marked // as cf_audited_transfer. Index: test/Analysis/retain-release-gc-only.m =================================================================== --- test/Analysis/retain-release-gc-only.m +++ test/Analysis/retain-release-gc-only.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple %itanium_abi_triple -analyze -analyzer-checker=core,osx.cocoa.RetainCount,osx.cocoa.NSAutoreleasePool -analyzer-store=region -fobjc-gc-only -fblocks -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -triple %itanium_abi_triple -analyze -analyzer-checker=core,osx.cocoa.RetainCount,osx.cocoa.NSAutoreleasePool -analyzer-store=region -fobjc-gc-only -fblocks -verify -Wno-objc-root-class %s //===----------------------------------------------------------------------===// // Header stuff. Index: test/Analysis/retain-release-inline.m =================================================================== --- test/Analysis/retain-release-inline.m +++ test/Analysis/retain-release-inline.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -fblocks -verify %s //===----------------------------------------------------------------------===// // The following code is reduced using delta-debugging from Mac OS X headers: Index: test/Analysis/retain-release-path-notes-gc.m =================================================================== --- test/Analysis/retain-release-path-notes-gc.m +++ test/Analysis/retain-release-path-notes-gc.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fobjc-gc-only -analyzer-output=text -verify %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fobjc-gc-only -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fobjc-gc-only -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fobjc-gc-only -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist // RUN: FileCheck --input-file=%t.plist %s /*** Index: test/Analysis/retain-release-path-notes.m =================================================================== --- test/Analysis/retain-release-path-notes.m +++ test/Analysis/retain-release-path-notes.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=text -verify %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t // RUN: FileCheck --input-file=%t %s /*** Index: test/Analysis/retain-release-region-store.m =================================================================== --- test/Analysis/retain-release-region-store.m +++ test/Analysis/retain-release-region-store.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple %itanium_abi_triple -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -analyzer-max-loop 6 -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple %itanium_abi_triple -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -analyzer-max-loop 6 -verify %s //===----------------------------------------------------------------------===// // The following code is reduced using delta-debugging from Index: test/Analysis/retain-release.m =================================================================== --- test/Analysis/retain-release.m +++ test/Analysis/retain-release.m @@ -1,6 +1,6 @@ // RUN: rm -f %t.objc.plist %t.objcpp.plist -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fblocks -verify -Wno-objc-root-class %s -analyzer-output=plist -o %t.objc.plist -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fblocks -verify -x objective-c++ -std=gnu++98 -Wno-objc-root-class %s -analyzer-output=plist -o %t.objcpp.plist +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fblocks -verify -Wno-objc-root-class %s -analyzer-output=plist -o %t.objc.plist +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fblocks -verify -x objective-c++ -std=gnu++98 -Wno-objc-root-class %s -analyzer-output=plist -o %t.objcpp.plist // FIXLATER: cat %t.objc.plist ; FileCheck --input-file=%t.objc.plist %s // FIXLATER: cat %t.objcpp.plist ; FileCheck --input-file=%t.objcpp.plist %s Index: test/Analysis/retain-release.mm =================================================================== --- test/Analysis/retain-release.mm +++ test/Analysis/retain-release.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fblocks -verify %s #if __has_feature(attribute_ns_returns_retained) #define NS_RETURNS_RETAINED __attribute__((ns_returns_retained)) Index: test/Analysis/return-ptr-range.cpp =================================================================== --- test/Analysis/return-ptr-range.cpp +++ test/Analysis/return-ptr-range.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.security.ReturnPtrRange -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.security.ReturnPtrRange -verify %s int arr[10]; int *ptr; Index: test/Analysis/security-syntax-checks-no-emit.c =================================================================== --- test/Analysis/security-syntax-checks-no-emit.c +++ test/Analysis/security-syntax-checks-no-emit.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i686-pc-linux-gnu -analyze -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple i686-pc-linux-gnu -analyze -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify // expected-no-diagnostics // This file complements 'security-syntax-checks.m', but tests that we omit Index: test/Analysis/security-syntax-checks.m =================================================================== --- test/Analysis/security-syntax-checks.m +++ test/Analysis/security-syntax-checks.m @@ -1,11 +1,11 @@ -// 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 -// RUN: %clang_cc1 -triple x86_64-unknown-cloudabi -analyze -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify -// RUN: %clang_cc1 -triple x86_64-unknown-cloudabi -analyze -DUSE_BUILTINS -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify -// RUN: %clang_cc1 -triple x86_64-unknown-cloudabi -analyze -DVARIANT -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify -// RUN: %clang_cc1 -triple x86_64-unknown-cloudabi -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -analyze -DUSE_BUILTINS -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -analyze -DVARIANT -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple i386-apple-darwin10 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-unknown-cloudabi -analyze -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-unknown-cloudabi -analyze -DUSE_BUILTINS -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-unknown-cloudabi -analyze -DVARIANT -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-unknown-cloudabi -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify #ifdef USE_BUILTINS # define BUILTIN(f) __builtin_ ## f Index: test/Analysis/self-assign.cpp =================================================================== --- test/Analysis/self-assign.cpp +++ test/Analysis/self-assign.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -analyze -analyzer-checker=core,cplusplus,unix.Malloc,debug.ExprInspection %s -verify -analyzer-output=text +// RUN: %clang_cc1 %z3_cc1 -std=c++11 -analyze -analyzer-checker=core,cplusplus,unix.Malloc,debug.ExprInspection %s -verify -analyzer-output=text extern "C" char *strdup(const char* s); extern "C" void free(void* ptr); Index: test/Analysis/self-init.m =================================================================== --- test/Analysis/self-init.m +++ test/Analysis/self-init.m @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.SelfInit -analyzer-config ipa=dynamic -fno-builtin %s -verify -// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.SelfInit -fno-builtin %s -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=osx.cocoa.SelfInit -analyzer-config ipa=dynamic -fno-builtin %s -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=osx.cocoa.SelfInit -fno-builtin %s -verify @class NSZone, NSCoder; @protocol NSObject Index: test/Analysis/shallow-mode.m =================================================================== --- test/Analysis/shallow-mode.m +++ test/Analysis/shallow-mode.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config mode=shallow -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config mode=shallow -verify %s // expected-no-diagnostics void clang_analyzer_checkInlined(unsigned); Index: test/Analysis/simple-stream-checks.c =================================================================== --- test/Analysis/simple-stream-checks.c +++ test/Analysis/simple-stream-checks.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.unix.SimpleStream -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.unix.SimpleStream -verify %s #include "Inputs/system-header-simulator-for-simple-stream.h" Index: test/Analysis/sizeofpointer.c =================================================================== --- test/Analysis/sizeofpointer.c +++ test/Analysis/sizeofpointer.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.core.SizeofPtr -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.core.SizeofPtr -verify %s struct s { }; Index: test/Analysis/stack-addr-ps.c =================================================================== --- test/Analysis/stack-addr-ps.c +++ test/Analysis/stack-addr-ps.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -verify %s int* f1() { int x = 0; Index: test/Analysis/stack-addr-ps.cpp =================================================================== --- test/Analysis/stack-addr-ps.cpp +++ test/Analysis/stack-addr-ps.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s -Wno-undefined-bool-conversion +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s -Wno-undefined-bool-conversion typedef __INTPTR_TYPE__ intptr_t; Index: test/Analysis/stack-block-returned.cpp =================================================================== --- test/Analysis/stack-block-returned.cpp +++ test/Analysis/stack-block-returned.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -verify %s typedef void (^bptr)(void); Index: test/Analysis/stackaddrleak.c =================================================================== --- test/Analysis/stackaddrleak.c +++ test/Analysis/stackaddrleak.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -std=c99 -Dbool=_Bool -Wno-bool-conversion %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -x c++ -Wno-bool-conversion %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify -std=c99 -Dbool=_Bool -Wno-bool-conversion %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify -x c++ -Wno-bool-conversion %s typedef __INTPTR_TYPE__ intptr_t; char const *p; Index: test/Analysis/static_local.m =================================================================== --- test/Analysis/static_local.m +++ test/Analysis/static_local.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify -Wno-objc-root-class %s // expected-no-diagnostics // Test reasoning about static locals in ObjCMethods. Index: test/Analysis/stats.c =================================================================== --- test/Analysis/stats.c +++ test/Analysis/stats.c @@ -1,5 +1,5 @@ // REQUIRES: asserts -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-stats %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-stats %s 2>&1 | FileCheck %s void foo() { int x; Index: test/Analysis/std-c-library-functions.c =================================================================== --- test/Analysis/std-c-library-functions.c +++ test/Analysis/std-c-library-functions.c @@ -1,8 +1,8 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=unix.StdCLibraryFunctions,debug.ExprInspection -verify %s -// RUN: %clang_cc1 -triple i686-unknown-linux -analyze -analyzer-checker=unix.StdCLibraryFunctions,debug.ExprInspection -verify %s -// RUN: %clang_cc1 -triple x86_64-unknown-linux -analyze -analyzer-checker=unix.StdCLibraryFunctions,debug.ExprInspection -verify %s -// RUN: %clang_cc1 -triple armv7-a15-linux -analyze -analyzer-checker=unix.StdCLibraryFunctions,debug.ExprInspection -verify %s -// RUN: %clang_cc1 -triple thumbv7-a15-linux -analyze -analyzer-checker=unix.StdCLibraryFunctions,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=unix.StdCLibraryFunctions,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple i686-unknown-linux -analyze -analyzer-checker=unix.StdCLibraryFunctions,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-unknown-linux -analyze -analyzer-checker=unix.StdCLibraryFunctions,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple armv7-a15-linux -analyze -analyzer-checker=unix.StdCLibraryFunctions,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple thumbv7-a15-linux -analyze -analyzer-checker=unix.StdCLibraryFunctions,debug.ExprInspection -verify %s void clang_analyzer_eval(int); Index: test/Analysis/std-c-library-functions.cpp =================================================================== --- test/Analysis/std-c-library-functions.cpp +++ test/Analysis/std-c-library-functions.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-linux -analyze -analyzer-checker=unix.StdCLibraryFunctions,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-unknown-linux -analyze -analyzer-checker=unix.StdCLibraryFunctions,debug.ExprInspection -verify %s // Test that we don't model functions with broken prototypes. // Because they probably work differently as well. Index: test/Analysis/stream.c =================================================================== --- test/Analysis/stream.c +++ test/Analysis/stream.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.unix.Stream -analyzer-store region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.unix.Stream -analyzer-store region -verify %s typedef __typeof__(sizeof(int)) size_t; typedef struct _IO_FILE FILE; Index: test/Analysis/string-fail.c =================================================================== --- test/Analysis/string-fail.c +++ test/Analysis/string-fail.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s -// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s // XFAIL: * // This file is for tests that may eventually go into string.c, or may be Index: test/Analysis/string.c =================================================================== --- test/Analysis/string.c +++ test/Analysis/string.c @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -Wno-null-dereference -verify %s -// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -Wno-null-dereference -verify %s -// RUN: %clang_cc1 -analyze -DVARIANT -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -Wno-null-dereference -verify %s -// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=alpha.security.taint,core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -Wno-null-dereference -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -Wno-null-dereference -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -Wno-null-dereference -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -DVARIANT -analyzer-checker=core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -Wno-null-dereference -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -DUSE_BUILTINS -DVARIANT -analyzer-checker=alpha.security.taint,core,unix.cstring,alpha.unix.cstring,debug.ExprInspection -analyzer-store=region -Wno-null-dereference -verify %s //===----------------------------------------------------------------------=== // Declarations Index: test/Analysis/superclass.m =================================================================== --- test/Analysis/superclass.m +++ test/Analysis/superclass.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fblocks -analyze -analyzer-checker=osx.cocoa.MissingSuperCall -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -fblocks -analyze -analyzer-checker=osx.cocoa.MissingSuperCall -verify -Wno-objc-root-class %s // Define used Classes @protocol NSObject Index: test/Analysis/svalbuilder-logic.c =================================================================== --- test/Analysis/svalbuilder-logic.c +++ test/Analysis/svalbuilder-logic.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix -verify %s // expected-no-diagnostics // Testing core functionality of the SValBuilder. Index: test/Analysis/switch-case.c =================================================================== --- test/Analysis/switch-case.c +++ test/Analysis/switch-case.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s void clang_analyzer_eval(int); void clang_analyzer_warnIfReached(); Index: test/Analysis/symbol-reaper.c =================================================================== --- test/Analysis/symbol-reaper.c +++ test/Analysis/symbol-reaper.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.ExprInspection -verify %s void clang_analyzer_eval(int); void clang_analyzer_warnOnDeadSymbol(int); Index: test/Analysis/taint-generic.c =================================================================== --- test/Analysis/taint-generic.c +++ test/Analysis/taint-generic.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.security.taint,core,alpha.security.ArrayBoundV2 -Wno-format-security -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.security.taint,core,alpha.security.ArrayBoundV2 -Wno-format-security -verify %s int scanf(const char *restrict format, ...); int getchar(void); Index: test/Analysis/taint-tester.c =================================================================== --- test/Analysis/taint-tester.c +++ test/Analysis/taint-tester.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-int-to-pointer-cast -analyze -analyzer-checker=alpha.security.taint,debug.TaintTest %s -verify +// RUN: %clang_cc1 %z3_cc1 -Wno-int-to-pointer-cast -analyze -analyzer-checker=alpha.security.taint,debug.TaintTest %s -verify #include "Inputs/system-header-simulator.h" Index: test/Analysis/taint-tester.cpp =================================================================== --- test/Analysis/taint-tester.cpp +++ test/Analysis/taint-tester.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.security.taint,debug.TaintTest %s -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.security.taint,debug.TaintTest %s -verify // expected-no-diagnostics typedef struct _FILE FILE; Index: test/Analysis/taint-tester.m =================================================================== --- test/Analysis/taint-tester.m +++ test/Analysis/taint-tester.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.security.taint,debug.TaintTest %s -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=alpha.security.taint,debug.TaintTest %s -verify // expected-no-diagnostics #import Index: test/Analysis/temp-obj-dtors-cfg-output.cpp =================================================================== --- test/Analysis/temp-obj-dtors-cfg-output.cpp +++ test/Analysis/temp-obj-dtors-cfg-output.cpp @@ -1,7 +1,7 @@ // RUN: rm -f %t -// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -analyzer-config cfg-temporary-dtors=true -std=c++98 %s > %t 2>&1 +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.DumpCFG -analyzer-config cfg-temporary-dtors=true -std=c++98 %s > %t 2>&1 // RUN: FileCheck --input-file=%t -check-prefix=CXX98 -check-prefix=CHECK %s -// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -analyzer-config cfg-temporary-dtors=true -std=c++11 %s > %t 2>&1 +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.DumpCFG -analyzer-config cfg-temporary-dtors=true -std=c++11 %s > %t 2>&1 // RUN: FileCheck --input-file=%t -check-prefix=CXX11 -check-prefix=CHECK %s class A { Index: test/Analysis/templates.cpp =================================================================== --- test/Analysis/templates.cpp +++ test/Analysis/templates.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -fblocks -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -fblocks -analyzer-config c++-template-inlining=false -DNO_INLINE -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -fblocks -analyzer-config c++-template-inlining=false -DNO_INLINE -verify %s void clang_analyzer_eval(bool); Index: test/Analysis/temporaries.cpp =================================================================== --- test/Analysis/temporaries.cpp +++ test/Analysis/temporaries.cpp @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify -w -std=c++03 %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify -w -std=c++11 %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -DTEMPORARY_DTORS -verify -w -analyzer-config cfg-temporary-dtors=true %s -std=c++11 +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify -w -std=c++03 %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify -w -std=c++11 %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -DTEMPORARY_DTORS -verify -w -analyzer-config cfg-temporary-dtors=true %s -std=c++11 extern bool clang_analyzer_eval(bool); extern bool clang_analyzer_warnIfReached(); Index: test/Analysis/test-after-div-zero.c =================================================================== --- test/Analysis/test-after-div-zero.c +++ test/Analysis/test-after-div-zero.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=c99 -Dbool=_Bool -analyze -analyzer-checker=core,alpha.core.TestAfterDivZero -analyzer-output=text -verify %s -// RUN: %clang_cc1 -x c++ -analyze -analyzer-checker=core,alpha.core.TestAfterDivZero -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -std=c99 -Dbool=_Bool -analyze -analyzer-checker=core,alpha.core.TestAfterDivZero -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -x c++ -analyze -analyzer-checker=core,alpha.core.TestAfterDivZero -analyzer-output=text -verify %s int var; Index: test/Analysis/test-include-cpp.cpp =================================================================== --- test/Analysis/test-include-cpp.cpp +++ test/Analysis/test-include-cpp.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify %s #include "test-include-cpp.h" Index: test/Analysis/test-include.c =================================================================== --- test/Analysis/test-include.c +++ test/Analysis/test-include.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify %s #include "test-include.h" #define DIVYX(X,Y) Y/X Index: test/Analysis/test-objc-non-nil-return-value-checker.m =================================================================== --- test/Analysis/test-objc-non-nil-return-value-checker.m +++ test/Analysis/test-objc-non-nil-return-value-checker.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.NonNilReturnValue,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=osx.cocoa.NonNilReturnValue,debug.ExprInspection -verify %s typedef unsigned int NSUInteger; typedef signed char BOOL; Index: test/Analysis/test-variably-modified-types.c =================================================================== --- test/Analysis/test-variably-modified-types.c +++ test/Analysis/test-variably-modified-types.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyze-function=testVariablyModifiedTypes -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyze-function=testVariablyModifiedTypes -verify %s // Test that we process variably modified type correctly - the call graph construction should pick up function_with_bug while recursively visiting test_variably_modifiable_types. unsigned getArraySize(int *x) { Index: test/Analysis/traversal-algorithm.mm =================================================================== --- test/Analysis/traversal-algorithm.mm +++ test/Analysis/traversal-algorithm.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpTraversal -analyzer-max-loop 4 -std=c++11 %s | FileCheck -check-prefix=DFS %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=debug.DumpTraversal -analyzer-max-loop 4 -std=c++11 %s | FileCheck -check-prefix=DFS %s int a(); int b(); Index: test/Analysis/traversal-begin-end-function.c =================================================================== --- test/Analysis/traversal-begin-end-function.c +++ test/Analysis/traversal-begin-end-function.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.DumpTraversal %s | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.DumpTraversal %s | FileCheck %s void inline_callee(int i); Index: test/Analysis/traversal-path-unification.c =================================================================== --- test/Analysis/traversal-path-unification.c +++ test/Analysis/traversal-path-unification.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.DumpTraversal %s | FileCheck %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.DumpTraversal -DUSE_EXPR %s | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.DumpTraversal %s | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.DumpTraversal -DUSE_EXPR %s | FileCheck %s int a(); int b(); Index: test/Analysis/ubigraph-viz.cpp =================================================================== --- test/Analysis/ubigraph-viz.cpp +++ test/Analysis/ubigraph-viz.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.API -analyzer-viz-egraph-ubigraph -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.API -analyzer-viz-egraph-ubigraph -verify %s // expected-no-diagnostics int f(int x) { Index: test/Analysis/undef-buffers.c =================================================================== --- test/Analysis/undef-buffers.c +++ test/Analysis/undef-buffers.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix,core.uninitialized -analyzer-store=region -verify -analyzer-config unix:Optimistic=true %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix,core.uninitialized -analyzer-store=region -verify -analyzer-config unix:Optimistic=true %s typedef __typeof(sizeof(int)) size_t; void *malloc(size_t); void free(void *); Index: test/Analysis/uninit-const.c =================================================================== --- test/Analysis/uninit-const.c +++ test/Analysis/uninit-const.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=unix.Malloc,core,alpha.core.CallAndMessageUnInitRefArg -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=unix.Malloc,core,alpha.core.CallAndMessageUnInitRefArg -analyzer-output=text -verify %s // Passing uninitialized const data to function #include "Inputs/system-header-simulator.h" Index: test/Analysis/uninit-const.cpp =================================================================== --- test/Analysis/uninit-const.cpp +++ test/Analysis/uninit-const.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=cplusplus.NewDelete,core,alpha.core.CallAndMessageUnInitRefArg -analyzer-output=text -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=cplusplus.NewDelete,core,alpha.core.CallAndMessageUnInitRefArg -analyzer-output=text -verify %s // Passing uninitialized const data to unknown function #include "Inputs/system-header-simulator-cxx.h" Index: test/Analysis/uninit-msg-expr.m =================================================================== --- test/Analysis/uninit-msg-expr.m +++ test/Analysis/uninit-msg-expr.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s //===----------------------------------------------------------------------===// // The following code is reduced using delta-debugging from Index: test/Analysis/uninit-ps-rdar6145427.m =================================================================== --- test/Analysis/uninit-ps-rdar6145427.m +++ test/Analysis/uninit-ps-rdar6145427.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -analyzer-store=region %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify -analyzer-store=region %s // Delta-Debugging reduced preamble. typedef signed char BOOL; Index: test/Analysis/uninit-sometimes.cpp =================================================================== --- test/Analysis/uninit-sometimes.cpp +++ test/Analysis/uninit-sometimes.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=gnu++11 -Wsometimes-uninitialized -verify %s -// RUN: %clang_cc1 -std=gnu++11 -Wsometimes-uninitialized -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 %z3_cc1 -std=gnu++11 -Wsometimes-uninitialized -verify %s +// RUN: %clang_cc1 %z3_cc1 -std=gnu++11 -Wsometimes-uninitialized -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s bool maybe(); Index: test/Analysis/uninit-vals-ps-region.m =================================================================== --- test/Analysis/uninit-vals-ps-region.m +++ test/Analysis/uninit-vals-ps-region.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-store=region -analyzer-checker=core -verify %s struct s { int data; Index: test/Analysis/uninit-vals-ps.c =================================================================== --- test/Analysis/uninit-vals-ps.c +++ test/Analysis/uninit-vals-ps.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store=region -fblocks -verify %s struct FPRec { void (*my_func)(int * x); Index: test/Analysis/uninit-vals-union.c =================================================================== --- test/Analysis/uninit-vals-union.c +++ test/Analysis/uninit-vals-union.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core.builtin -analyzer-store=region -verify -Wno-unused %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core.builtin -analyzer-store=region -verify -Wno-unused %s typedef union { int y; Index: test/Analysis/uninit-vals.cpp =================================================================== --- test/Analysis/uninit-vals.cpp +++ test/Analysis/uninit-vals.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core.builtin -verify -DCHECK_FOR_CRASH %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core.builtin -verify -DCHECK_FOR_CRASH %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify %s #ifdef CHECK_FOR_CRASH // expected-no-diagnostics Index: test/Analysis/uninit-vals.m =================================================================== --- test/Analysis/uninit-vals.m +++ test/Analysis/uninit-vals.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -verify %s typedef unsigned int NSUInteger; typedef __typeof__(sizeof(int)) size_t; Index: test/Analysis/unions-region.m =================================================================== --- test/Analysis/unions-region.m +++ test/Analysis/unions-region.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region %s -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -analyzer-store=region %s -verify // expected-no-diagnostics //===-- unions-region.m ---------------------------------------------------===// Index: test/Analysis/unions.cpp =================================================================== --- test/Analysis/unions.cpp +++ test/Analysis/unions.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection %s -verify +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection %s -verify extern void clang_analyzer_eval(bool); extern "C" char *strdup(const char *s); Index: test/Analysis/unix-api.c =================================================================== --- test/Analysis/unix-api.c +++ test/Analysis/unix-api.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.API -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.API -verify %s #ifndef O_RDONLY #define O_RDONLY 0 Index: test/Analysis/unix-api.cpp =================================================================== --- test/Analysis/unix-api.cpp +++ test/Analysis/unix-api.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.API -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.API -verify %s extern "C" { #ifndef O_RDONLY #define O_RDONLY 0 Index: test/Analysis/unix-fns.c =================================================================== --- test/Analysis/unix-fns.c +++ test/Analysis/unix-fns.c @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,unix.API,osx.API %s -analyzer-store=region -analyzer-output=plist -analyzer-eagerly-assume -analyzer-config faux-bodies=true -analyzer-config path-diagnostics-alternate=false -fblocks -verify -o %t.plist +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,unix.API,osx.API %s -analyzer-store=region -analyzer-output=plist -analyzer-eagerly-assume -analyzer-config faux-bodies=true -analyzer-config path-diagnostics-alternate=false -fblocks -verify -o %t.plist // RUN: FileCheck --input-file=%t.plist %s // RUN: mkdir -p %t.dir -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.API,osx.API -analyzer-output=html -analyzer-config faux-bodies=true -fblocks -o %t.dir %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,unix.API,osx.API -analyzer-output=html -analyzer-config faux-bodies=true -fblocks -o %t.dir %s // RUN: rm -fR %t.dir struct _opaque_pthread_once_t { long __sig; Index: test/Analysis/unreachable-code-path.c =================================================================== --- test/Analysis/unreachable-code-path.c +++ test/Analysis/unreachable-code-path.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,deadcode.DeadStores,alpha.deadcode.UnreachableCode -verify -analyzer-opt-analyze-nested-blocks -Wno-unused-value %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,deadcode.DeadStores,alpha.deadcode.UnreachableCode -verify -analyzer-opt-analyze-nested-blocks -Wno-unused-value %s extern void foo(int a); Index: test/Analysis/unsupported-types.c =================================================================== --- /dev/null +++ test/Analysis/unsupported-types.c @@ -0,0 +1,31 @@ +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -triple x86_64-unknown-linux -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -triple powerpc64-linux-gnu -verify %s + +#define _Complex_I (__extension__ 1.0iF) + +void clang_analyzer_eval(int); + +void complex_float(double _Complex x, double _Complex y) { + clang_analyzer_eval(x == y); // expected-warning{{UNKNOWN}} + if (x != 1.0 + 3.0 * _Complex_I && y != 1.0 - 4.0 * _Complex_I) + return + clang_analyzer_eval(x == y); // expected-warning{{UNKNOWN}} + clang_analyzer_eval(x + y == 2.0 - 1.0 * _Complex_I); // expected-warning{{UNKNOWN}} +} + +void complex_int(int _Complex x, int _Complex y) { + clang_analyzer_eval(x == y); // expected-warning{{UNKNOWN}} + if (x != 1.0 + 3.0 * _Complex_I && y != 1.0 - 4.0 * _Complex_I) + return + clang_analyzer_eval(x == y); // expected-warning{{UNKNOWN}} + clang_analyzer_eval(x + y == 2.0 - 1.0 * _Complex_I); // expected-warning{{UNKNOWN}} +} + +void longdouble_float(long double x, long double y) { + clang_analyzer_eval(x == y); // expected-warning{{UNKNOWN}} + if (x != 0.0L && y != 1.0L) + return + clang_analyzer_eval(x == y); // expected-warning{{UNKNOWN}} + clang_analyzer_eval(x + y == 1.0L); // expected-warning{{UNKNOWN}} +} Index: test/Analysis/unused-ivars.m =================================================================== --- test/Analysis/unused-ivars.m +++ test/Analysis/unused-ivars.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fblocks -analyze -analyzer-checker=osx.cocoa.UnusedIvars -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 %z3_cc1 -fblocks -analyze -analyzer-checker=osx.cocoa.UnusedIvars -verify -Wno-objc-root-class %s //===--- BEGIN: Delta-debugging reduced headers. --------------------------===// Index: test/Analysis/valist-uninitialized.c =================================================================== --- test/Analysis/valist-uninitialized.c +++ test/Analysis/valist-uninitialized.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -analyze -analyzer-checker=core,alpha.valist.Uninitialized,alpha.valist.CopyToSelf -analyzer-output=text -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-pc-linux-gnu -analyze -analyzer-checker=core,alpha.valist.Uninitialized,alpha.valist.CopyToSelf -analyzer-output=text -analyzer-store=region -verify %s #include "Inputs/system-header-simulator-for-valist.h" Index: test/Analysis/valist-unterminated.c =================================================================== --- test/Analysis/valist-unterminated.c +++ test/Analysis/valist-unterminated.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -analyze -analyzer-checker=core,alpha.valist.Unterminated,alpha.valist.CopyToSelf -analyzer-output=text -analyzer-store=region -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-pc-linux-gnu -analyze -analyzer-checker=core,alpha.valist.Unterminated,alpha.valist.CopyToSelf -analyzer-output=text -analyzer-store=region -verify %s #include "Inputs/system-header-simulator-for-valist.h" Index: test/Analysis/variadic-method-types.m =================================================================== --- test/Analysis/variadic-method-types.m +++ test/Analysis/variadic-method-types.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.VariadicMethodTypes -analyzer-store=region -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.cocoa.VariadicMethodTypes -analyzer-store=region -fblocks -verify %s //===----------------------------------------------------------------------===// // The following code is reduced using delta-debugging from Index: test/Analysis/vfork.c =================================================================== --- test/Analysis/vfork.c +++ test/Analysis/vfork.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,security.insecureAPI.vfork,unix.Vfork -verify %s -// RUN: %clang_cc1 -analyze -analyzer-checker=core,security.insecureAPI.vfork,unix.Vfork -verify -x c++ %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,security.insecureAPI.vfork,unix.Vfork -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,security.insecureAPI.vfork,unix.Vfork -verify -x c++ %s #include "Inputs/system-header-simulator.h" Index: test/Analysis/virtualcall.cpp =================================================================== --- test/Analysis/virtualcall.cpp +++ test/Analysis/virtualcall.cpp @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=optin.cplusplus.VirtualCall -analyzer-store region -verify -std=c++11 %s -// RUN: %clang_cc1 -analyze -analyzer-checker=optin.cplusplus.VirtualCall -analyzer-store region -analyzer-config optin.cplusplus.VirtualCall:Interprocedural=true -DINTERPROCEDURAL=1 -verify -std=c++11 %s -// RUN: %clang_cc1 -analyze -analyzer-checker=optin.cplusplus.VirtualCall -analyzer-store region -analyzer-config optin.cplusplus.VirtualCall:PureOnly=true -DPUREONLY=1 -verify -std=c++11 %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=optin.cplusplus.VirtualCall -analyzer-store region -verify -std=c++11 %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=optin.cplusplus.VirtualCall -analyzer-store region -analyzer-config optin.cplusplus.VirtualCall:Interprocedural=true -DINTERPROCEDURAL=1 -verify -std=c++11 %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=optin.cplusplus.VirtualCall -analyzer-store region -analyzer-config optin.cplusplus.VirtualCall:PureOnly=true -DPUREONLY=1 -verify -std=c++11 %s /* When INTERPROCEDURAL is set, we expect diagnostics in all functions reachable from a constructor or destructor. If it is not set, we expect diagnostics Index: test/Analysis/vla.c =================================================================== --- test/Analysis/vla.c +++ test/Analysis/vla.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core -verify %s // Zero-sized VLAs. void check_zero_sized_VLA(int x) { Index: test/Analysis/weak-functions.c =================================================================== --- test/Analysis/weak-functions.c +++ test/Analysis/weak-functions.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection,unix.Malloc,unix.cstring,alpha.unix.cstring,unix.API,osx.API,osx.cocoa.RetainCount -Wno-null-dereference -Wno-tautological-compare -analyzer-store=region -fblocks -verify %s +// RUN: %clang_cc1 %z3_cc1 -analyze -analyzer-checker=core,alpha.core,debug.ExprInspection,unix.Malloc,unix.cstring,alpha.unix.cstring,unix.API,osx.API,osx.cocoa.RetainCount -Wno-null-dereference -Wno-tautological-compare -analyzer-store=region -fblocks -verify %s #define NULL 0 void clang_analyzer_eval(int); void myFunc(); Index: test/lit.cfg =================================================================== --- test/lit.cfg +++ test/lit.cfg @@ -482,6 +482,14 @@ else: config.available_features.add("nozlib") +if has_plugins and config.have_z3 == "1": + config.available_features.add("z3") + config.substitutions.append( ('%z3_cc1', '-load ' + config.llvm_shlib_dir + '/Z3ConstraintManagerPlugin' + config.llvm_plugin_ext) ) + config.substitutions.append( ('%z3', '-fplugin=' + config.llvm_shlib_dir + '/Z3ConstraintManagerPlugin' + config.llvm_plugin_ext) ) +else: + config.substitutions.append( ('%z3_cc1', '') ) + config.substitutions.append( ('%z3', '') ) + # Check if we should run long running tests. if lit_config.params.get("run_long_tests", None) == "true": config.available_features.add("long_tests") Index: test/lit.site.cfg.in =================================================================== --- test/lit.site.cfg.in +++ test/lit.site.cfg.in @@ -15,6 +15,7 @@ config.target_triple = "@TARGET_TRIPLE@" config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" config.have_zlib = "@HAVE_LIBZ@" +config.have_z3 = "@CLANG_HAVE_Z3@" config.clang_arcmt = @ENABLE_CLANG_ARCMT@ config.clang_default_cxx_stdlib = "@CLANG_DEFAULT_CXX_STDLIB@" config.clang_staticanalyzer = @ENABLE_CLANG_STATIC_ANALYZER@ Index: tools/CMakeLists.txt =================================================================== --- tools/CMakeLists.txt +++ tools/CMakeLists.txt @@ -19,6 +19,9 @@ add_clang_subdirectory(clang-check) add_clang_subdirectory(scan-build) add_clang_subdirectory(scan-view) + if(CLANG_HAVE_Z3) + add_clang_subdirectory(z3-constraint-manager) + endif() endif() # We support checking out the clang-tools-extra repository into the 'extra' Index: tools/z3-constraint-manager/CMakeLists.txt =================================================================== --- /dev/null +++ tools/z3-constraint-manager/CMakeLists.txt @@ -0,0 +1,19 @@ +set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Z3ConstraintManager.exports) + +set(LLVM_LINK_COMPONENTS Support) + +add_llvm_loadable_module(Z3ConstraintManagerPlugin + Z3ConstraintManager.cpp + + PLUGIN_TOOL + clang + ) + +include_directories(SYSTEM + ${Z3_INCLUDE_DIR} + ) + +target_link_libraries(Z3ConstraintManagerPlugin PRIVATE + ${Z3_LIBRARIES} + clangStaticAnalyzerCore + ) Index: tools/z3-constraint-manager/README =================================================================== --- /dev/null +++ tools/z3-constraint-manager/README @@ -0,0 +1,16 @@ +This plugin implements a constraint manager for the Clang Static Analyzer +using the Z3 constraint solver: + +https://github.com/z3prover/z3 + +## Building + +Please build and install Z3 first. It should then be automatically detected. + +## Usage + +Use the plug-in like so: + + clang -Xclang -load -Xclang path/to/Z3ConstraintManagerPlugin.so \ + -Xanalyzer -analyzer-constraints=z3 \ + --analyze ... Index: tools/z3-constraint-manager/Z3ConstraintManager.cpp =================================================================== --- /dev/null +++ tools/z3-constraint-manager/Z3ConstraintManager.cpp @@ -0,0 +1,1399 @@ +//== Z3ConstraintManager.cpp --------------------------------*- C++ -*--==// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "clang/Basic/TargetInfo.h" +#include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h" +#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h" +#include "clang/StaticAnalyzer/Core/PathSensitive/SimpleConstraintManager.h" + +#include + +using namespace clang; +using namespace ento; + +namespace { +class Z3Expr { + static Z3_context ZC; + Z3_ast AST; + + Z3Expr(Z3_ast ZA) : AST(ZA) { Z3_inc_ref(ZC, AST); } + + // Return an appropriate floating-point rounding mode. + static Z3Expr getFloatRoundingMode() { + // TODO: Don't assume nearest ties to even rounding mode + return Z3Expr(Z3_mk_fpa_rne(Z3Expr::ZC)); + } + + // Return an appropriate floating-point sort for the given bitwidth. + static Z3_sort getFloatSort(unsigned BitWidth) { + switch (BitWidth) { + default: + llvm_unreachable("Unsupported floating-point bitwidth!"); + break; + case 16: + return Z3_mk_fpa_sort_16(Z3Expr::ZC); + case 32: + return Z3_mk_fpa_sort_32(Z3Expr::ZC); + case 64: + return Z3_mk_fpa_sort_64(Z3Expr::ZC); + case 128: + return Z3_mk_fpa_sort_128(Z3Expr::ZC); + } + } + + // Determine whether two float semantics are equivalent + static bool areEquivalent(const llvm::fltSemantics &LHS, + const llvm::fltSemantics &RHS) { + return (llvm::APFloat::semanticsPrecision(LHS) == + llvm::APFloat::semanticsPrecision(RHS)) && + (llvm::APFloat::semanticsMinExponent(LHS) == + llvm::APFloat::semanticsMinExponent(RHS)) && + (llvm::APFloat::semanticsMaxExponent(LHS) == + llvm::APFloat::semanticsMaxExponent(RHS)) && + (llvm::APFloat::semanticsSizeInBits(LHS) == + llvm::APFloat::semanticsSizeInBits(RHS)); + } + +public: + /// Override implicit copy constructor for correct reference counting. + Z3Expr(const Z3Expr &Copy) : AST(Copy.AST) { Z3_inc_ref(Z3Expr::ZC, AST); } + + ~Z3Expr() { Z3_dec_ref(Z3Expr::ZC, AST); } + + /// Generate a simplified AST by calling the Z3 simplifier. + Z3Expr simplify() const { return Z3Expr(Z3_simplify(Z3Expr::ZC, AST)); } + + /// Given a model, extract the value of this operand in the model. + bool getInterpretation(const Z3_model &Model, llvm::APSInt &Int) const { + Z3_func_decl Func = Z3_get_app_decl(Z3Expr::ZC, Z3_to_app(Z3Expr::ZC, AST)); + if (Z3_model_has_interp(Z3Expr::ZC, Model, Func) != Z3_L_TRUE) + return false; + + Z3_ast Assign = Z3_model_get_const_interp(Z3Expr::ZC, Model, Func); + Z3_sort Sort = Z3_get_sort(Z3Expr::ZC, Assign); + return Z3Expr::toAPSInt(Sort, Assign, Int, true); + } + + /// Given a model, extract the value of this operand in the model. + bool getInterpretation(const Z3_model &Model, llvm::APFloat &Float) const { + Z3_func_decl Func = Z3_get_app_decl(Z3Expr::ZC, Z3_to_app(Z3Expr::ZC, AST)); + if (Z3_model_has_interp(Z3Expr::ZC, Model, Func) != Z3_L_TRUE) + return false; + + Z3_ast Assign = Z3_model_get_const_interp(Z3Expr::ZC, Model, Func); + Z3_sort Sort = Z3_get_sort(Z3Expr::ZC, Assign); + return Z3Expr::toAPFloat(Sort, Assign, Float, true); + } + + /// Given a solver object, add this constraint to the solver. + void addToSolver(const Z3_solver &Solver) const { + Z3_solver_assert(Z3Expr::ZC, Solver, AST); + } + + /// Get the corresponding IEEE floating-point type for a given bitwidth. + static const llvm::fltSemantics &getFloatSemantics(unsigned BitWidth) { + switch (BitWidth) { + default: + llvm_unreachable("Unsupported floating-point semantics!"); + break; + case 16: + return llvm::APFloat::IEEEhalf(); + case 32: + return llvm::APFloat::IEEEsingle(); + case 64: + return llvm::APFloat::IEEEdouble(); + case 128: + return llvm::APFloat::IEEEquad(); + } + } + + /// Set the Z3 context. + static void setContext(const Z3_context &Context) { Z3Expr::ZC = Context; } + + /// Construct a Z3Expr from a unary operator, given a Z3_context. + static Z3Expr fromUnOp(const UnaryOperator::Opcode Op, const Z3Expr &Exp) { + Z3_ast AST; + + switch (Op) { + default: + llvm_unreachable("Unimplemented opcode"); + break; + + case UO_Minus: + AST = Z3_mk_bvneg(Z3Expr::ZC, Exp.AST); + break; + + case UO_Not: + AST = Z3_mk_bvnot(Z3Expr::ZC, Exp.AST); + break; + + case UO_LNot: + AST = Z3_mk_not(Z3Expr::ZC, Exp.AST); + break; + } + + return Z3Expr(AST); + } + + /// Construct a Z3Expr from a floating-point unary operator, given a + /// Z3_context. + static Z3Expr fromFloatUnOp(const UnaryOperator::Opcode Op, + const Z3Expr &Exp) { + Z3_ast AST; + + switch (Op) { + default: + llvm_unreachable("Unimplemented opcode"); + break; + + case UO_Minus: + AST = Z3_mk_fpa_neg(Z3Expr::ZC, Exp.AST); + break; + + case UO_LNot: + AST = Z3_mk_not(Z3Expr::ZC, Exp.AST); + break; + } + + return Z3Expr(AST); + } + + /// Construct a Z3Expr from a binary operator, given a Z3_context. + static Z3Expr fromBinOp(const Z3Expr &LHS, const BinaryOperator::Opcode Op, + const Z3Expr &RHS, bool isSigned) { + Z3_ast AST; + + assert(Z3_is_eq_sort(Z3Expr::ZC, Z3_get_sort(Z3Expr::ZC, LHS.AST), + Z3_get_sort(Z3Expr::ZC, RHS.AST)) && + "AST's must have the same sort!"); + + switch (Op) { + default: + llvm_unreachable("Unimplemented opcode"); + break; + + // Multiplicative operators + case BO_Mul: + AST = Z3_mk_bvmul(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_Div: + AST = isSigned ? Z3_mk_bvsdiv(Z3Expr::ZC, LHS.AST, RHS.AST) + : Z3_mk_bvudiv(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_Rem: + AST = isSigned ? Z3_mk_bvsrem(Z3Expr::ZC, LHS.AST, RHS.AST) + : Z3_mk_bvurem(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + + // Additive operators + case BO_Add: + AST = Z3_mk_bvadd(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_Sub: + AST = Z3_mk_bvsub(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + + // Bitwise shift operators + case BO_Shl: + AST = Z3_mk_bvshl(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_Shr: + AST = isSigned ? Z3_mk_bvashr(Z3Expr::ZC, LHS.AST, RHS.AST) + : Z3_mk_bvlshr(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + + // Relational operators + case BO_LT: + AST = isSigned ? Z3_mk_bvslt(Z3Expr::ZC, LHS.AST, RHS.AST) + : Z3_mk_bvult(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_GT: + AST = isSigned ? Z3_mk_bvsgt(Z3Expr::ZC, LHS.AST, RHS.AST) + : Z3_mk_bvugt(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_LE: + AST = isSigned ? Z3_mk_bvsle(Z3Expr::ZC, LHS.AST, RHS.AST) + : Z3_mk_bvule(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_GE: + AST = isSigned ? Z3_mk_bvsge(Z3Expr::ZC, LHS.AST, RHS.AST) + : Z3_mk_bvuge(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + + // Equality operators + case BO_EQ: + AST = Z3_mk_eq(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_NE: + return Z3Expr::fromUnOp(UO_LNot, + Z3Expr::fromBinOp(LHS, BO_EQ, RHS, isSigned)); + break; + + // Bitwise operators + case BO_And: + AST = Z3_mk_bvand(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_Xor: + AST = Z3_mk_bvxor(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_Or: + AST = Z3_mk_bvor(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + + // Logical operators + case BO_LAnd: { + Z3_ast Args[] = {LHS.AST, RHS.AST}; + AST = Z3_mk_and(Z3Expr::ZC, sizeof(Args) / sizeof(*Args), Args); + break; + } + case BO_LOr: { + Z3_ast Args[] = {LHS.AST, RHS.AST}; + AST = Z3_mk_or(Z3Expr::ZC, sizeof(Args) / sizeof(*Args), Args); + break; + } + } + + return Z3Expr(AST); + } + + /// Construct a Z3Expr from a special floating-point binary operator, given a + /// Z3_context. + static Z3Expr fromFloatSpecialBinOp(const Z3Expr &LHS, + const BinaryOperator::Opcode Op, + const llvm::APFloat::fltCategory &RHS) { + Z3_ast AST; + + switch (Op) { + default: + llvm_unreachable("Unimplemented opcode"); + break; + + // Equality operators + case BO_EQ: + switch (RHS) { + case llvm::APFloat::fcInfinity: + AST = Z3_mk_fpa_is_infinite(Z3Expr::ZC, LHS.AST); + break; + case llvm::APFloat::fcNaN: + AST = Z3_mk_fpa_is_nan(Z3Expr::ZC, LHS.AST); + break; + case llvm::APFloat::fcNormal: + AST = Z3_mk_fpa_is_normal(Z3Expr::ZC, LHS.AST); + break; + case llvm::APFloat::fcZero: + AST = Z3_mk_fpa_is_zero(Z3Expr::ZC, LHS.AST); + break; + } + break; + case BO_NE: + return Z3Expr::fromFloatUnOp( + UO_LNot, Z3Expr::fromFloatSpecialBinOp(LHS, BO_EQ, RHS)); + break; + } + + return Z3Expr(AST); + } + + /// Construct a Z3Expr from a floating-point binary operator, given a + /// Z3_context. + static Z3Expr fromFloatBinOp(const Z3Expr &LHS, + const BinaryOperator::Opcode Op, + const Z3Expr &RHS) { + Z3_ast AST; + + assert(Z3_is_eq_sort(Z3Expr::ZC, Z3_get_sort(Z3Expr::ZC, LHS.AST), + Z3_get_sort(Z3Expr::ZC, RHS.AST)) && + "AST's must have the same sort!"); + + switch (Op) { + default: + llvm_unreachable("Unimplemented opcode"); + break; + + // Multiplicative operators + case BO_Mul: { + Z3Expr RoundingMode = Z3Expr::getFloatRoundingMode(); + AST = Z3_mk_fpa_mul(Z3Expr::ZC, RoundingMode.AST, LHS.AST, RHS.AST); + break; + } + case BO_Div: { + Z3Expr RoundingMode = Z3Expr::getFloatRoundingMode(); + AST = Z3_mk_fpa_div(Z3Expr::ZC, RoundingMode.AST, LHS.AST, RHS.AST); + break; + } + case BO_Rem: + AST = Z3_mk_fpa_rem(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + + // Additive operators + case BO_Add: { + Z3Expr RoundingMode = Z3Expr::getFloatRoundingMode(); + AST = Z3_mk_fpa_add(Z3Expr::ZC, RoundingMode.AST, LHS.AST, RHS.AST); + break; + } + case BO_Sub: { + Z3Expr RoundingMode = Z3Expr::getFloatRoundingMode(); + AST = Z3_mk_fpa_sub(Z3Expr::ZC, RoundingMode.AST, LHS.AST, RHS.AST); + break; + } + + // Relational operators + case BO_LT: + AST = Z3_mk_fpa_lt(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_GT: + AST = Z3_mk_fpa_gt(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_LE: + AST = Z3_mk_fpa_leq(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_GE: + AST = Z3_mk_fpa_geq(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + + // Equality operators + case BO_EQ: + AST = Z3_mk_fpa_eq(Z3Expr::ZC, LHS.AST, RHS.AST); + break; + case BO_NE: + return Z3Expr::fromFloatUnOp(UO_LNot, + Z3Expr::fromFloatBinOp(LHS, BO_EQ, RHS)); + break; + + // Logical operators + case BO_LAnd: { + Z3_ast Args[] = {LHS.AST, RHS.AST}; + AST = Z3_mk_and(Z3Expr::ZC, sizeof(Args) / sizeof(*Args), Args); + break; + } + case BO_LOr: { + Z3_ast Args[] = {LHS.AST, RHS.AST}; + AST = Z3_mk_or(Z3Expr::ZC, sizeof(Args) / sizeof(*Args), Args); + break; + } + } + + return Z3Expr(AST); + } + + /// Construct a Z3Expr from a SymbolData, given a Z3_context. + static Z3Expr fromData(const SymbolID ID, bool isBool, bool isFloat, + uint64_t BitWidth) { + llvm::Twine Name = "$" + llvm::Twine(ID); + + Z3_sort Sort; + if (isBool) + Sort = Z3_mk_bool_sort(Z3Expr::ZC); + else if (isFloat) + Sort = Z3Expr::getFloatSort(BitWidth); + else + Sort = Z3_mk_bv_sort(Z3Expr::ZC, BitWidth); + + Z3_symbol Symbol = Z3_mk_string_symbol(Z3Expr::ZC, Name.str().c_str()); + Z3_ast AST = Z3_mk_const(Z3Expr::ZC, Symbol, Sort); + return Z3Expr(AST); + } + + /// Construct a Z3Expr from a SymbolCast, given a Z3_context. + static Z3Expr fromCast(const Z3Expr &Exp, QualType ToTy, uint64_t ToBitWidth, + QualType FromTy, uint64_t FromBitWidth) { + Z3_ast AST; + + if ((FromTy->isIntegralOrEnumerationType() && + ToTy->isIntegralOrEnumerationType()) || + (FromTy->isAnyPointerType() ^ ToTy->isAnyPointerType()) || + (FromTy->isBlockPointerType() ^ ToTy->isBlockPointerType()) || + (FromTy->isReferenceType() ^ ToTy->isReferenceType())) { + // Special case: Z3 boolean type is distinct from bitvector type, so + // must use if-then-else expression instead of direct cast + if (FromTy->isBooleanType()) { + assert(ToBitWidth > 0 && "BitWidth must be positive!"); + Z3Expr Zero = Z3Expr::fromInt("0", ToBitWidth); + Z3Expr One = Z3Expr::fromInt("1", ToBitWidth); + AST = Z3_mk_ite(Z3Expr::ZC, Exp.AST, One.AST, Zero.AST); + } else if (ToBitWidth > FromBitWidth) { + AST = + FromTy->isSignedIntegerOrEnumerationType() + ? Z3_mk_sign_ext(Z3Expr::ZC, ToBitWidth - FromBitWidth, Exp.AST) + : Z3_mk_zero_ext(Z3Expr::ZC, ToBitWidth - FromBitWidth, + Exp.AST); + } else if (ToBitWidth < FromBitWidth) { + AST = Z3_mk_extract(Z3Expr::ZC, ToBitWidth - 1, 0, Exp.AST); + } else { + // Both are bitvectors with the same width, ignore the type cast + return Exp; + } + } else if (FromTy->isRealFloatingType() && ToTy->isRealFloatingType()) { + if (ToBitWidth != FromBitWidth) { + Z3Expr RoundingMode = Z3Expr::getFloatRoundingMode(); + Z3_sort Sort = Z3Expr::getFloatSort(ToBitWidth); + AST = + Z3_mk_fpa_to_fp_float(Z3Expr::ZC, RoundingMode.AST, Exp.AST, Sort); + } else { + return Exp; + } + } else if (FromTy->isIntegralOrEnumerationType() && + ToTy->isRealFloatingType()) { + Z3Expr RoundingMode = Z3Expr::getFloatRoundingMode(); + Z3_sort Sort = Z3Expr::getFloatSort(ToBitWidth); + AST = FromTy->isSignedIntegerOrEnumerationType() + ? Z3_mk_fpa_to_fp_signed(Z3Expr::ZC, RoundingMode.AST, Exp.AST, + Sort) + : Z3_mk_fpa_to_fp_unsigned(Z3Expr::ZC, RoundingMode.AST, + Exp.AST, Sort); + } else if (FromTy->isRealFloatingType() && + ToTy->isIntegralOrEnumerationType()) { + Z3Expr RoundingMode = Z3Expr::getFloatRoundingMode(); + AST = ToTy->isSignedIntegerOrEnumerationType() + ? Z3_mk_fpa_to_sbv(Z3Expr::ZC, RoundingMode.AST, Exp.AST, + ToBitWidth) + : Z3_mk_fpa_to_ubv(Z3Expr::ZC, RoundingMode.AST, Exp.AST, + ToBitWidth); + } else { + llvm_unreachable("Unsupported explicit type cast!"); + } + + return Z3Expr(AST); + } + + /// Construct a Z3Expr from a boolean, given a Z3_context. + static Z3Expr fromBoolean(const bool Bool) { + Z3_ast AST = Bool ? Z3_mk_true(Z3Expr::ZC) : Z3_mk_false(Z3Expr::ZC); + return Z3Expr(AST); + } + + /// Construct a Z3Expr from a finite APFloat, given a Z3_context. + static Z3Expr fromAPFloat(const llvm::APFloat &Float) { + Z3_ast AST; + Z3_sort Sort = Z3Expr::getFloatSort( + llvm::APFloat::semanticsSizeInBits(Float.getSemantics())); + switch (Float.getCategory()) { + case llvm::APFloat::fcInfinity: + AST = Z3_mk_fpa_inf(Z3Expr::ZC, Sort, Float.isNegative()); + break; + case llvm::APFloat::fcNaN: + AST = Z3_mk_fpa_nan(Z3Expr::ZC, Sort); + break; + case llvm::APFloat::fcZero: + AST = Z3_mk_fpa_zero(Z3Expr::ZC, Sort, Float.isNegative()); + break; + case llvm::APFloat::fcNormal: { + SmallString<24> Chars; + // Note: Z3 <= 4.4.1 has floating-point string parsing bug with '+' + // https://github.com/Z3Prover/z3/commit/0cb8193cdd2f2e5ae88fbc1565ddf00eaa323067 + Float.toString(Chars, 0, 0); + AST = Z3_mk_numeral(Z3Expr::ZC, Chars.c_str(), Sort); + break; + } + } + return Z3Expr(AST); + } + + /// Construct a Z3Expr from an APSInt, given a Z3_context. + static Z3Expr fromAPSInt(const llvm::APSInt &Int) { + Z3_sort Sort = Z3_mk_bv_sort(Z3Expr::ZC, Int.getBitWidth()); + Z3_ast AST = Z3_mk_numeral(Z3Expr::ZC, Int.toString(10).c_str(), Sort); + return Z3Expr(AST); + } + + /// Construct a Z3Expr from an integer, given a Z3_context. + static Z3Expr fromInt(const char *Int, uint64_t BitWidth) { + Z3_sort Sort = Z3_mk_bv_sort(Z3Expr::ZC, BitWidth); + Z3_ast AST = Z3_mk_numeral(Z3Expr::ZC, Int, Sort); + return Z3Expr(AST); + } + + /// Construct an APFloat from a Z3Expr, given the AST representation + static bool toAPFloat(const Z3_sort &Sort, const Z3_ast &AST, + llvm::APFloat &Float, bool useSemantics = true) { + StringRef Integer, Exponent; + llvm::SmallString<24> Scientific; + + assert(Z3_get_sort_kind(Z3Expr::ZC, Sort) == Z3_FLOATING_POINT_SORT && + "Unsupported sort to floating-point!"); + StringRef String = Z3_get_numeral_string(Z3Expr::ZC, AST); + const llvm::fltSemantics &Semantics = + Z3Expr::getFloatSemantics(Z3_fpa_get_ebits(Z3Expr::ZC, Sort) + + Z3_fpa_get_sbits(Z3Expr::ZC, Sort)); + + if (useSemantics && + !Z3Expr::areEquivalent(Float.getSemantics(), Semantics)) { + assert(false && "Floating-point types don't match!"); + return false; + } + + if (String.endswith("zero")) { + Float = llvm::APFloat::getZero(Semantics, String.front() == '-'); + return true; + } else if (String.endswith("oo")) { + Float = llvm::APFloat::getInf(Semantics, String.front() == '-'); + return true; + } else if (String.endswith("NaN")) { + Float = llvm::APFloat::getQNaN(Semantics, String.front() == '-'); + return true; + } + + // Replace the ' ' with an 'e' for scientific notation, e.g. in "1.24 -10" + std::tie(Integer, Exponent) = String.split(' '); + llvm::Twine Concat(Integer + "e" + Exponent); + + Float = llvm::APFloat(Semantics); + llvm::APFloat::opStatus Status = + Float.convertFromString(Concat.toNullTerminatedStringRef(Scientific), + llvm::APFloat::rmNearestTiesToEven); + return !(Status & llvm::APFloat::opInvalidOp); + } + + /// Construct an APInt from a Z3Expr, given the AST representation + static bool toAPSInt(const Z3_sort &Sort, const Z3_ast &AST, + llvm::APSInt &Int, bool useSemantics = true) { + switch (Z3_get_sort_kind(Z3Expr::ZC, Sort)) { + default: + llvm_unreachable("Unsupported sort to integer!"); + case Z3_BV_SORT: { + uint64_t Value; + // Force cast because Z3 defines __uint64 to be a unsigned long long + // type, which isn't compatible with a unsigned long type, even if they + // are the same size. + Z3_get_numeral_uint64(Z3Expr::ZC, AST, + reinterpret_cast<__uint64 *>(&Value)); + if (useSemantics && + Int.getBitWidth() != Z3_get_bv_sort_size(Z3Expr::ZC, Sort)) { + assert(false && "Bitvector types don't match!"); + return false; + } + + Int = llvm::APInt(Int.getBitWidth(), Value); + return true; + } + case Z3_BOOL_SORT: + if (useSemantics && Int.getBitWidth() < 1) { + assert(false && "Boolean type doesn't match!"); + return false; + } + Int = + llvm::APInt(Int.getBitWidth(), + Z3_get_bool_value(Z3Expr::ZC, AST) == Z3_L_TRUE ? 1 : 0); + return true; + } + } + + void Profile(llvm::FoldingSetNodeID &ID) const { + ID.AddInteger(Z3_get_ast_hash(Z3Expr::ZC, AST)); + } + + bool operator<(const Z3Expr &Other) const { + llvm::FoldingSetNodeID ID1, ID2; + Profile(ID1); + Other.Profile(ID2); + return ID1 < ID2; + } + + /// Comparison of AST equality, not model equivalence. + bool operator==(const Z3Expr &Other) const { + assert(Z3_is_eq_sort(Z3Expr::ZC, Z3_get_sort(Z3Expr::ZC, AST), + Z3_get_sort(Z3Expr::ZC, Other.AST)) && + "AST's must have the same sort"); + return Z3_is_eq_ast(Z3Expr::ZC, AST, Other.AST); + } + + /// Override implicit move constructor for correct reference counting. + Z3Expr &operator=(const Z3Expr &Move) { + Z3_inc_ref(Z3Expr::ZC, Move.AST); + Z3_dec_ref(Z3Expr::ZC, AST); + AST = Move.AST; + return *this; + } + + void print(raw_ostream &OS) const { OS << Z3_ast_to_string(Z3Expr::ZC, AST); } + + LLVM_DUMP_METHOD void dump() const { print(llvm::errs()); } +}; // end class Z3Expr + +void Z3ErrorHandler(Z3_context Context, Z3_error_code Error) { + llvm::report_fatal_error("Z3 error: " + + llvm::Twine(Z3_get_error_msg_ex(Context, Error))); +} + +Z3_context Z3Expr::ZC; +} // end anonymous namespace + +// Use macro to avoid problems with textual substitution +#define Z3SetPair llvm::ImmutableSet> +REGISTER_TRAIT_WITH_PROGRAMSTATE(ConstraintZ3, Z3SetPair) + +namespace { +class Z3ConstraintManager : public SimpleConstraintManager { + Z3_context ZC; + +public: + Z3ConstraintManager(SubEngine *SE, SValBuilder &SB) + : SimpleConstraintManager(SE, SB) { + Z3_config Config = Z3_mk_config(); + // Enable model finding + Z3_set_param_value(Config, "model", "true"); + // Set timeout to 15000ms = 15s + Z3_set_param_value(Config, "timeout", "15000"); + ZC = Z3_mk_context_rc(Config); + Z3_set_error_handler(ZC, Z3ErrorHandler); + Z3_del_config(Config); + + Z3Expr::setContext(ZC); + } + + ~Z3ConstraintManager() override { Z3_del_context(ZC); } + + //===------------------------------------------------------------------===// + // Implementation for interface from ConstraintManager. + //===------------------------------------------------------------------===// + + bool canReasonAbout(SVal X) const override; + + ConditionTruthVal checkNull(ProgramStateRef State, SymbolRef Sym) override; + + const llvm::APSInt *getSymVal(ProgramStateRef State, + SymbolRef Sym) const override; + + ProgramStateRef removeDeadBindings(ProgramStateRef St, + SymbolReaper &SymReaper) override; + + void print(ProgramStateRef St, raw_ostream &Out, const char *nl, + const char *sep) override; + + //===------------------------------------------------------------------===// + // Implementation for interface from SimpleConstraintManager. + //===------------------------------------------------------------------===// + + ProgramStateRef assumeSym(ProgramStateRef state, SymbolRef Sym, + bool Assumption) override; + + ProgramStateRef assumeSymInclusiveRange(ProgramStateRef State, SymbolRef Sym, + const llvm::APSInt &From, + const llvm::APSInt &To, + bool InRange) override; + + ProgramStateRef assumeSymUnsupported(ProgramStateRef State, SymbolRef Sym, + bool Assumption) override; + +private: + //===------------------------------------------------------------------===// + // Internal implementation. + //===------------------------------------------------------------------===// + + // Check whether a new model is satisfiable, and update the program state. + ProgramStateRef assumeZ3Expr(ProgramStateRef State, SymbolRef Sym, + const Z3Expr &Exp); + + // Generate and check a Z3 model, using the given constraint. + Z3_lbool checkZ3Model(ProgramStateRef State, const Z3Expr &Exp) const; + + // Generate and check a Z3 model, then get the value of the given symbol in + // the model. + // Sets the Value parameter to the model value, if successful. + template + Z3_lbool getZ3Model(ProgramStateRef State, const Z3Expr &Exp, T &Value) const; + + // Generate a Z3Expr that represents the given symbolic expression. + // Sets the hasComparison parameter if the expression has a comparison + // operator. + // Sets the RetTy parameter to the final return type after promotions and + // casts. + Z3Expr getZ3Expr(SymbolRef Sym, QualType *RetTy = nullptr, + bool *hasComparison = nullptr) const; + + // Generate a Z3Expr that takes the logical not of an expression. + Z3Expr getZ3NotExpr(const Z3Expr &Exp) const; + + // Generate a Z3Expr that compares the expression to zero. + Z3Expr getZ3ZeroExpr(const Z3Expr &Exp, QualType RetTy, + bool Assumption) const; + + // Recursive implementation to unpack and generate symbolic expression. + // Sets the hasComparison and RetTy parameters. See getZ3Expr(). + Z3Expr getZ3SymExpr(SymbolRef Sym, QualType *RetTy, + bool *hasComparison) const; + + // Wrapper to generate Z3Expr from SymbolData. + Z3Expr getZ3DataExpr(const SymbolID ID, QualType Ty) const; + + // Wrapper to generate Z3Expr from SymbolCast. + Z3Expr getZ3CastExpr(const Z3Expr &Exp, QualType FromTy, QualType Ty) const; + + // Wrapper to generate Z3Expr from BinarySymExpr. + // Sets the hasComparison and RetTy parameters. See getZ3Expr(). + Z3Expr getZ3SymBinExpr(const BinarySymExpr *BSE, bool *hasComparison, + QualType *RetTy) const; + + // Wrapper to generate Z3Expr from unpacked binary symbolic expression. + // Sets the RetTy parameter. See getZ3Expr(). + Z3Expr getZ3BinExpr(const Z3Expr &LHS, QualType LTy, + BinaryOperator::Opcode Op, const Z3Expr &RHS, + QualType RTy, QualType *RetTy) const; + + //===------------------------------------------------------------------===// + // Helper functions. + //===------------------------------------------------------------------===// + + // Recover the QualType of an APSInt. + // TODO: Refactor to put elsewhere + QualType getAPSIntType(const llvm::APSInt &Int) const; + + // Perform implicit type conversion on binary symbolic expressions. + // May modify all input parameters. + // TODO: Refactor to use built-in conversion functions + void doTypeConversion(Z3Expr &LHS, Z3Expr &RHS, QualType <y, + QualType &RTy) const; + + // Perform implicit integer type conversion. + // May modify all input parameters. + // TODO: Refactor to use Sema::handleIntegerConversion() + template + void doIntTypeConversion(T &LHS, QualType <y, T &RHS, QualType &RTy) const; + + // Perform implicit floating-point type conversion. + // May modify all input parameters. + // TODO: Refactor to use Sema::handleFloatConversion() + template + void doFloatTypeConversion(T &LHS, QualType <y, T &RHS, + QualType &RTy) const; + + // Callback function for doCast parameter on APSInt type. + static llvm::APSInt castAPSInt(const llvm::APSInt &V, QualType ToTy, + uint64_t ToWidth, QualType FromTy, + uint64_t FromWidth); +}; // end class Z3ConstraintManager + +} // end anonymous namespace + +ProgramStateRef Z3ConstraintManager::assumeSym(ProgramStateRef State, + SymbolRef Sym, bool Assumption) { + QualType RetTy; + bool hasComparison; + + Z3Expr Exp = getZ3Expr(Sym, &RetTy, &hasComparison); + // Create zero comparison for implicit boolean cast, with reversed assumption + if (!hasComparison && !RetTy->isBooleanType()) + return assumeZ3Expr(State, Sym, getZ3ZeroExpr(Exp, RetTy, !Assumption)); + + return assumeZ3Expr(State, Sym, Assumption ? Exp : getZ3NotExpr(Exp)); +} + +ProgramStateRef Z3ConstraintManager::assumeSymInclusiveRange( + ProgramStateRef State, SymbolRef Sym, const llvm::APSInt &From, + const llvm::APSInt &To, bool InRange) { + QualType RetTy; + // The expression may be casted, so we cannot call getZ3DataExpr() directly + Z3Expr Exp = getZ3Expr(Sym, &RetTy); + + assert((getAPSIntType(From) == getAPSIntType(To)) && + "Range values have different types!"); + QualType RTy = getAPSIntType(From); + bool isSignedTy = RetTy->isSignedIntegerOrEnumerationType(); + Z3Expr FromExp = Z3Expr::fromAPSInt(From); + Z3Expr ToExp = Z3Expr::fromAPSInt(To); + + // Construct single (in)equality + if (From == To) + return assumeZ3Expr(State, Sym, + getZ3BinExpr(Exp, RetTy, InRange ? BO_EQ : BO_NE, + FromExp, RTy, nullptr)); + + // Construct two (in)equalities, and a logical and/or + Z3Expr LHS = + getZ3BinExpr(Exp, RetTy, InRange ? BO_GE : BO_LT, FromExp, RTy, nullptr); + Z3Expr RHS = + getZ3BinExpr(Exp, RetTy, InRange ? BO_LE : BO_GT, ToExp, RTy, nullptr); + return assumeZ3Expr( + State, Sym, + Z3Expr::fromBinOp(LHS, InRange ? BO_LAnd : BO_LOr, RHS, isSignedTy)); +} + +ProgramStateRef Z3ConstraintManager::assumeSymUnsupported(ProgramStateRef State, + SymbolRef Sym, + bool Assumption) { + // Skip anything that is unsupported + return State; +} + +bool Z3ConstraintManager::canReasonAbout(SVal X) const { + const TargetInfo &TI = getBasicVals().getContext().getTargetInfo(); + + Optional SymVal = X.getAs(); + if (!SymVal) + return true; + + const SymExpr *Sym = SymVal->getSymbol(); + do { + QualType Ty = Sym->getType(); + + // Complex types are not modeled + if (Ty->isComplexType() || Ty->isComplexIntegerType()) + return false; + + // Non-IEEE 754 floating-point types are not modeled + if ((Ty->isSpecificBuiltinType(BuiltinType::LongDouble) && + (&TI.getLongDoubleFormat() == &llvm::APFloat::x87DoubleExtended() || + &TI.getLongDoubleFormat() == &llvm::APFloat::PPCDoubleDouble()))) + return false; + + if (isa(Sym)) { + break; + } else if (const SymbolCast *SC = dyn_cast(Sym)) { + Sym = SC->getOperand(); + } else if (const BinarySymExpr *BSE = dyn_cast(Sym)) { + if (const SymIntExpr *SIE = dyn_cast(BSE)) { + Sym = SIE->getLHS(); + } else if (const IntSymExpr *ISE = dyn_cast(BSE)) { + Sym = ISE->getRHS(); + } else if (const SymSymExpr *SSM = dyn_cast(BSE)) { + return canReasonAbout(nonloc::SymbolVal(SSM->getLHS())) && + canReasonAbout(nonloc::SymbolVal(SSM->getRHS())); + } else { + llvm_unreachable("Unsupported binary expression to reason about!"); + } + } else { + llvm_unreachable("Unsupported expression to reason about!"); + } + } while (Sym); + + return true; +} + +ConditionTruthVal Z3ConstraintManager::checkNull(ProgramStateRef State, + SymbolRef Sym) { + QualType RetTy; + // The expression may be casted, so we cannot call getZ3DataExpr() directly + Z3Expr VarExp = getZ3Expr(Sym, &RetTy); + Z3Expr Exp = getZ3ZeroExpr(VarExp, RetTy, true); + // Negate the constraint + Z3Expr NotExpr = getZ3ZeroExpr(VarExp, RetTy, false); + + Z3_lbool isSat = checkZ3Model(State, Exp); + Z3_lbool isNotSat = checkZ3Model(State, NotExpr); + // Zero is the only possible solution + if (isSat == Z3_L_TRUE && isNotSat == Z3_L_FALSE) + return true; + // Zero is not a solution + else if (isSat == Z3_L_FALSE && isNotSat == Z3_L_TRUE) + return false; + + // Zero may be a solution + return ConditionTruthVal(); +} + +const llvm::APSInt *Z3ConstraintManager::getSymVal(ProgramStateRef State, + SymbolRef Sym) const { + BasicValueFactory &BV = getBasicVals(); + ASTContext &Ctx = BV.getContext(); + + if (const SymbolData *SD = dyn_cast(Sym)) { + QualType Ty = Sym->getType(); + assert(!Ty->isRealFloatingType()); + llvm::APSInt Value(Ctx.getTypeSize(Ty), + !Ty->isSignedIntegerOrEnumerationType()); + + Z3Expr Exp = getZ3DataExpr(SD->getSymbolID(), Ty); + if (getZ3Model(State, Exp, Value) != Z3_L_TRUE) + return nullptr; + + // A value has been obtained, need to check if it is the only value + Z3Expr NotExpr = Z3Expr::fromBinOp( + Exp, BO_NE, + Ty->isBooleanType() ? Z3Expr::fromBoolean(Value.getBoolValue()) + : Z3Expr::fromAPSInt(Value), + false); + if (checkZ3Model(State, NotExpr) == Z3_L_TRUE) + return nullptr; + + // This is the only solution, store it + return &BV.getValue(Value); + } else if (const SymbolCast *SC = dyn_cast(Sym)) { + SymbolRef CastSym = SC->getOperand(); + QualType CastTy = SC->getType(); + // Skip the void type + if (CastTy->isVoidType()) + return nullptr; + + const llvm::APSInt *Value; + if (!(Value = getSymVal(State, CastSym))) + return nullptr; + return &BV.Convert(SC->getType(), *Value); + } else if (const BinarySymExpr *BSE = dyn_cast(Sym)) { + const llvm::APSInt *LHS, *RHS; + if (const SymIntExpr *SIE = dyn_cast(BSE)) { + LHS = getSymVal(State, SIE->getLHS()); + RHS = &SIE->getRHS(); + } else if (const IntSymExpr *ISE = dyn_cast(BSE)) { + LHS = &ISE->getLHS(); + RHS = getSymVal(State, ISE->getRHS()); + } else if (const SymSymExpr *SSM = dyn_cast(BSE)) { + // Early termination to avoid expensive call + LHS = getSymVal(State, SSM->getLHS()); + RHS = LHS ? getSymVal(State, SSM->getRHS()) : nullptr; + } else { + llvm_unreachable("Unsupported binary expression to get symbol value!"); + } + + if (!LHS || !RHS) + return nullptr; + + llvm::APSInt ConvertedLHS = *LHS, ConvertedRHS = *RHS; + QualType LTy = getAPSIntType(*LHS), RTy = getAPSIntType(*RHS); + doIntTypeConversion( + ConvertedLHS, LTy, ConvertedRHS, RTy); + return BV.evalAPSInt(BSE->getOpcode(), ConvertedLHS, ConvertedRHS); + } + + llvm_unreachable("Unsupported expression to get symbol value!"); +} + +ProgramStateRef +Z3ConstraintManager::removeDeadBindings(ProgramStateRef State, + SymbolReaper &SymReaper) { + ConstraintZ3Ty CZ = State->get(); + ConstraintZ3Ty::Factory &CZFactory = State->get_context(); + + for (ConstraintZ3Ty::iterator I = CZ.begin(), E = CZ.end(); I != E; ++I) { + if (SymReaper.maybeDead(I->first)) + CZ = CZFactory.remove(CZ, *I); + } + + return State->set(CZ); +} + +//===------------------------------------------------------------------===// +// Internal implementation. +//===------------------------------------------------------------------===// + +ProgramStateRef Z3ConstraintManager::assumeZ3Expr(ProgramStateRef State, + SymbolRef Sym, + const Z3Expr &Exp) { + // Simplify the AST + Z3Expr Simplify = Exp.simplify(); + // Check the model + if (checkZ3Model(State, Simplify) == Z3_L_TRUE) + return State->add(std::make_pair(Sym, Simplify)); + + return nullptr; +} + +Z3_lbool Z3ConstraintManager::checkZ3Model(ProgramStateRef State, + const Z3Expr &Exp) const { + Z3_lbool Result; + Z3_solver Solver = Z3_mk_solver(ZC); + + Z3_solver_inc_ref(ZC, Solver); + + // TODO: Don't add all the constraints, only the relevant ones + ConstraintZ3Ty CZ = State->get(); + for (ConstraintZ3Ty::iterator I = CZ.begin(), E = CZ.end(); I != E; ++I) { + I->second.addToSolver(Solver); + } + Exp.addToSolver(Solver); + + Result = Z3_solver_check(ZC, Solver); + Z3_solver_dec_ref(ZC, Solver); + return Result; +} + +template +Z3_lbool Z3ConstraintManager::getZ3Model(ProgramStateRef State, + const Z3Expr &Exp, T &Value) const { + Z3_lbool Result; + Z3_model Model; + Z3_solver Solver = Z3_mk_solver(ZC); + + Z3_solver_inc_ref(ZC, Solver); + + // TODO: Don't add all the constraints, only the relevant ones + ConstraintZ3Ty CZ = State->get(); + for (ConstraintZ3Ty::iterator I = CZ.begin(), E = CZ.end(); I != E; ++I) { + I->second.addToSolver(Solver); + } + + Result = Z3_solver_check(ZC, Solver); + + // The solver returned an unknown result (e.g. timeout), or not satisfiable + if (Result != Z3_L_TRUE) { + Z3_solver_dec_ref(ZC, Solver); + return Result; + } + + Model = Z3_solver_get_model(ZC, Solver); + + Z3_model_inc_ref(ZC, Model); + Z3_solver_dec_ref(ZC, Solver); + + // The model does not assign an interpretation + if (!Exp.getInterpretation(Model, Value)) { + Z3_model_dec_ref(ZC, Model); + return Z3_L_FALSE; + } + + Z3_model_dec_ref(ZC, Model); + return Z3_L_TRUE; +} + +Z3Expr Z3ConstraintManager::getZ3Expr(SymbolRef Sym, QualType *RetTy, + bool *hasComparison) const { + if (hasComparison) { + *hasComparison = false; + } + + return getZ3SymExpr(Sym, RetTy, hasComparison); +} + +Z3Expr Z3ConstraintManager::getZ3NotExpr(const Z3Expr &Exp) const { + return Z3Expr::fromUnOp(UO_LNot, Exp); +} + +Z3Expr Z3ConstraintManager::getZ3ZeroExpr(const Z3Expr &Exp, QualType Ty, + bool Assumption) const { + ASTContext &Ctx = getBasicVals().getContext(); + if (Ty->isRealFloatingType()) { + llvm::APFloat Zero = llvm::APFloat::getZero(Ctx.getFloatTypeSemantics(Ty)); + return Z3Expr::fromFloatBinOp(Exp, Assumption ? BO_EQ : BO_NE, + Z3Expr::fromAPFloat(Zero)); + } else if (Ty->isIntegralOrEnumerationType() || Ty->isAnyPointerType() || + Ty->isBlockPointerType() || Ty->isReferenceType()) { + bool isSigned = Ty->isSignedIntegerOrEnumerationType(); + // Skip explicit comparison for boolean types + if (Ty->isBooleanType()) + return Assumption ? getZ3NotExpr(Exp) : Exp; + return Z3Expr::fromBinOp(Exp, Assumption ? BO_EQ : BO_NE, + Z3Expr::fromInt("0", Ctx.getTypeSize(Ty)), + isSigned); + } + + llvm_unreachable("Unsupported type for zero value!"); +} + +Z3Expr Z3ConstraintManager::getZ3SymExpr(SymbolRef Sym, QualType *RetTy, + bool *hasComparison) const { + if (const SymbolData *SD = dyn_cast(Sym)) { + if (RetTy) + *RetTy = Sym->getType(); + + return getZ3DataExpr(SD->getSymbolID(), Sym->getType()); + } else if (const SymbolCast *SC = dyn_cast(Sym)) { + if (RetTy) + *RetTy = Sym->getType(); + + QualType FromTy; + Z3Expr Exp = getZ3SymExpr(SC->getOperand(), &FromTy, hasComparison); + // Casting an expression with a comparison invalidates it. Note that this + // must occur after the recursive call above. + // e.g. (signed char) (x > 0) + if (hasComparison) + *hasComparison = false; + return getZ3CastExpr(Exp, FromTy, Sym->getType()); + } else if (const BinarySymExpr *BSE = dyn_cast(Sym)) { + Z3Expr Exp = getZ3SymBinExpr(BSE, hasComparison, RetTy); + // Set the hasComparison parameter, in post-order traversal order. + if (hasComparison) + *hasComparison = BinaryOperator::isComparisonOp(BSE->getOpcode()); + return Exp; + } + + llvm_unreachable("Unsupported SymbolRef type!"); +} + +Z3Expr Z3ConstraintManager::getZ3DataExpr(const SymbolID ID, + QualType Ty) const { + ASTContext &Ctx = getBasicVals().getContext(); + return Z3Expr::fromData(ID, Ty->isBooleanType(), Ty->isRealFloatingType(), + Ctx.getTypeSize(Ty)); +} + +Z3Expr Z3ConstraintManager::getZ3CastExpr(const Z3Expr &Exp, QualType FromTy, + QualType ToTy) const { + ASTContext &Ctx = getBasicVals().getContext(); + return Z3Expr::fromCast(Exp, ToTy, Ctx.getTypeSize(ToTy), FromTy, + Ctx.getTypeSize(FromTy)); +} + +Z3Expr Z3ConstraintManager::getZ3SymBinExpr(const BinarySymExpr *BSE, + bool *hasComparison, + QualType *RetTy) const { + QualType LTy, RTy; + BinaryOperator::Opcode Op = BSE->getOpcode(); + + if (const SymIntExpr *SIE = dyn_cast(BSE)) { + RTy = getAPSIntType(SIE->getRHS()); + Z3Expr LHS = getZ3SymExpr(SIE->getLHS(), <y, hasComparison); + Z3Expr RHS = Z3Expr::fromAPSInt(SIE->getRHS()); + return getZ3BinExpr(LHS, LTy, Op, RHS, RTy, RetTy); + } else if (const IntSymExpr *ISE = dyn_cast(BSE)) { + LTy = getAPSIntType(ISE->getLHS()); + Z3Expr LHS = Z3Expr::fromAPSInt(ISE->getLHS()); + Z3Expr RHS = getZ3SymExpr(ISE->getRHS(), &RTy, hasComparison); + return getZ3BinExpr(LHS, LTy, Op, RHS, RTy, RetTy); + } else if (const SymSymExpr *SSM = dyn_cast(BSE)) { + Z3Expr LHS = getZ3SymExpr(SSM->getLHS(), <y, hasComparison); + Z3Expr RHS = getZ3SymExpr(SSM->getRHS(), &RTy, hasComparison); + return getZ3BinExpr(LHS, LTy, Op, RHS, RTy, RetTy); + } else { + llvm_unreachable("Unsupported BinarySymExpr type!"); + } +} + +Z3Expr Z3ConstraintManager::getZ3BinExpr(const Z3Expr &LHS, QualType LTy, + BinaryOperator::Opcode Op, + const Z3Expr &RHS, QualType RTy, + QualType *RetTy) const { + Z3Expr NewLHS = LHS; + Z3Expr NewRHS = RHS; + doTypeConversion(NewLHS, NewRHS, LTy, RTy); + // Update the return type parameter if the output type has changed. + if (RetTy) { + // A boolean result can be represented as an integer type in C/C++, but at + // this point we only care about the Z3 type. Set it as a boolean type to + // avoid subsequent Z3 errors. + if (BinaryOperator::isComparisonOp(Op) || BinaryOperator::isLogicalOp(Op)) { + ASTContext &Ctx = getBasicVals().getContext(); + *RetTy = Ctx.BoolTy; + } else { + *RetTy = LTy; + } + + // If the two operands are pointers and the operation is a subtraction, the + // result is of type ptrdiff_t, which is signed + if (LTy->isAnyPointerType() && LTy == RTy && Op == BO_Sub) { + ASTContext &Ctx = getBasicVals().getContext(); + *RetTy = Ctx.getIntTypeForBitwidth(Ctx.getTypeSize(LTy), true); + } + } + + return LTy->isRealFloatingType() + ? Z3Expr::fromFloatBinOp(NewLHS, Op, NewRHS) + : Z3Expr::fromBinOp(NewLHS, Op, NewRHS, + LTy->isSignedIntegerOrEnumerationType()); +} + +//===------------------------------------------------------------------===// +// Helper functions. +//===------------------------------------------------------------------===// + +QualType Z3ConstraintManager::getAPSIntType(const llvm::APSInt &Int) const { + ASTContext &Ctx = getBasicVals().getContext(); + return Ctx.getIntTypeForBitwidth(Int.getBitWidth(), Int.isSigned()); +} + +void Z3ConstraintManager::doTypeConversion(Z3Expr &LHS, Z3Expr &RHS, + QualType <y, QualType &RTy) const { + ASTContext &Ctx = getBasicVals().getContext(); + + // Perform type conversion + if (LTy->isIntegralOrEnumerationType() && + RTy->isIntegralOrEnumerationType()) { + if (LTy->isArithmeticType() && RTy->isArithmeticType()) + return doIntTypeConversion(LHS, LTy, RHS, RTy); + } else if (LTy->isRealFloatingType() || RTy->isRealFloatingType()) { + return doFloatTypeConversion(LHS, LTy, RHS, RTy); + } else if ((LTy->isAnyPointerType() || RTy->isAnyPointerType()) || + (LTy->isBlockPointerType() || RTy->isBlockPointerType()) || + (LTy->isReferenceType() || RTy->isReferenceType())) { + // TODO: Refactor to Sema::FindCompositePointerType(), and + // Sema::CheckCompareOperands(). + + uint64_t LBitWidth = Ctx.getTypeSize(LTy); + uint64_t RBitWidth = Ctx.getTypeSize(RTy); + + // Cast the non-pointer type to the pointer type. + // TODO: Be more strict about this. + if ((LTy->isAnyPointerType() ^ RTy->isAnyPointerType()) || + (LTy->isBlockPointerType() ^ RTy->isBlockPointerType()) || + (LTy->isReferenceType() ^ RTy->isReferenceType())) { + if (LTy->isNullPtrType() || LTy->isBlockPointerType() || + LTy->isReferenceType()) { + LHS = Z3Expr::fromCast(LHS, RTy, RBitWidth, LTy, LBitWidth); + LTy = RTy; + } else { + RHS = Z3Expr::fromCast(RHS, LTy, LBitWidth, RTy, RBitWidth); + RTy = LTy; + } + } + + // Cast the void pointer type to the non-void pointer type. + // For void types, this assumes that the casted value is equal to the value + // of the original pointer, and does not account for alignment requirements. + if (LTy->isVoidPointerType() ^ RTy->isVoidPointerType()) { + assert((Ctx.getTypeSize(LTy) == Ctx.getTypeSize(RTy)) && + "Pointer types have different bitwidths!"); + if (RTy->isVoidPointerType()) + RTy = LTy; + else + LTy = RTy; + } + + if (LTy == RTy) + return; + } + + // Fallback: for the solver, assume that these types don't really matter + if ((LTy.getCanonicalType() == RTy.getCanonicalType()) || + (LTy->isObjCObjectPointerType() && RTy->isObjCObjectPointerType())) { + LTy = RTy; + return; + } + + // TODO: Refine behavior for invalid type casts +} + +template +void Z3ConstraintManager::doIntTypeConversion(T &LHS, QualType <y, T &RHS, + QualType &RTy) const { + ASTContext &Ctx = getBasicVals().getContext(); + + uint64_t LBitWidth = Ctx.getTypeSize(LTy); + uint64_t RBitWidth = Ctx.getTypeSize(RTy); + + // Always perform integer promotion before checking type equality. + // Otherwise, e.g. (bool) a + (bool) b could trigger a backend assertion + if (LTy->isPromotableIntegerType()) { + QualType NewTy = Ctx.getPromotedIntegerType(LTy); + uint64_t NewBitWidth = Ctx.getTypeSize(NewTy); + LHS = (*doCast)(LHS, NewTy, NewBitWidth, LTy, LBitWidth); + LTy = NewTy; + LBitWidth = NewBitWidth; + } + if (RTy->isPromotableIntegerType()) { + QualType NewTy = Ctx.getPromotedIntegerType(RTy); + uint64_t NewBitWidth = Ctx.getTypeSize(NewTy); + RHS = (*doCast)(RHS, NewTy, NewBitWidth, RTy, RBitWidth); + RTy = NewTy; + RBitWidth = NewBitWidth; + } + + if (LTy == RTy) + return; + + // Perform integer type conversion + // Note: Safe to skip updating bitwidth because this must terminate + bool isLSignedTy = LTy->isSignedIntegerOrEnumerationType(); + bool isRSignedTy = RTy->isSignedIntegerOrEnumerationType(); + + int order = Ctx.getIntegerTypeOrder(LTy, RTy); + if (isLSignedTy == isRSignedTy) { + // Same signedness; use the higher-ranked type + if (order == 1) { + RHS = (*doCast)(RHS, LTy, LBitWidth, RTy, RBitWidth); + RTy = LTy; + } else { + LHS = (*doCast)(LHS, RTy, RBitWidth, LTy, LBitWidth); + LTy = RTy; + } + } else if (order != (isLSignedTy ? 1 : -1)) { + // The unsigned type has greater than or equal rank to the + // signed type, so use the unsigned type + if (isRSignedTy) { + RHS = (*doCast)(RHS, LTy, LBitWidth, RTy, RBitWidth); + RTy = LTy; + } else { + LHS = (*doCast)(LHS, RTy, RBitWidth, LTy, LBitWidth); + LTy = RTy; + } + } else if (LBitWidth != RBitWidth) { + // The two types are different widths; if we are here, that + // means the signed type is larger than the unsigned type, so + // use the signed type. + if (isLSignedTy) { + RHS = (*doCast)(RHS, LTy, LBitWidth, RTy, RBitWidth); + RTy = LTy; + } else { + LHS = (*doCast)(LHS, RTy, RBitWidth, LTy, LBitWidth); + LTy = RTy; + } + } else { + // The signed type is higher-ranked than the unsigned type, + // but isn't actually any bigger (like unsigned int and long + // on most 32-bit systems). Use the unsigned type corresponding + // to the signed type. + QualType NewTy = Ctx.getCorrespondingUnsignedType(isLSignedTy ? LTy : RTy); + RHS = (*doCast)(RHS, LTy, LBitWidth, RTy, RBitWidth); + RTy = NewTy; + LHS = (*doCast)(LHS, RTy, RBitWidth, LTy, LBitWidth); + LTy = NewTy; + } +} + +template +void Z3ConstraintManager::doFloatTypeConversion(T &LHS, QualType <y, T &RHS, + QualType &RTy) const { + ASTContext &Ctx = getBasicVals().getContext(); + + uint64_t LBitWidth = Ctx.getTypeSize(LTy); + uint64_t RBitWidth = Ctx.getTypeSize(RTy); + + // Perform float-point type promotion + if (!LTy->isRealFloatingType()) { + LHS = (*doCast)(LHS, RTy, RBitWidth, LTy, LBitWidth); + LTy = RTy; + LBitWidth = RBitWidth; + } + if (!RTy->isRealFloatingType()) { + RHS = (*doCast)(RHS, LTy, LBitWidth, RTy, RBitWidth); + RTy = LTy; + RBitWidth = LBitWidth; + } + + if (LTy == RTy) + return; + + // If we have two real floating types, convert the smaller operand to the + // bigger result + // Note: Safe to skip updating bitwidth because this must terminate + int order = Ctx.getFloatingTypeOrder(LTy, RTy); + if (order > 0) { + RHS = Z3Expr::fromCast(RHS, LTy, LBitWidth, RTy, RBitWidth); + RTy = LTy; + } else if (order == 0) { + LHS = Z3Expr::fromCast(LHS, RTy, RBitWidth, LTy, LBitWidth); + LTy = RTy; + } else { + llvm_unreachable("Unsupported floating-point type cast!"); + } +} + +llvm::APSInt Z3ConstraintManager::castAPSInt(const llvm::APSInt &V, + QualType ToTy, uint64_t ToWidth, + QualType FromTy, + uint64_t FromWidth) { + APSIntType TargetType(ToWidth, !ToTy->isSignedIntegerOrEnumerationType()); + return TargetType.convert(V); +} + +//==------------------------------------------------------------------------==/ +// Pretty-printing. +//==------------------------------------------------------------------------==/ + +void Z3ConstraintManager::print(ProgramStateRef St, raw_ostream &OS, + const char *nl, const char *sep) { + + ConstraintZ3Ty CZ = St->get(); + + OS << nl << sep << "Constraints:"; + for (ConstraintZ3Ty::iterator I = CZ.begin(), E = CZ.end(); I != E; ++I) { + OS << nl << ' ' << I->first << " : "; + I->second.print(OS); + } + OS << nl; +} + +extern "C" { +std::unique_ptr +CreateZ3ConstraintManager(ProgramStateManager &StMgr, + SubEngine *Eng) { + return llvm::make_unique(Eng, StMgr.getSValBuilder()); +} +} Index: tools/z3-constraint-manager/Z3ConstraintManager.exports =================================================================== --- /dev/null +++ tools/z3-constraint-manager/Z3ConstraintManager.exports @@ -0,0 +1 @@ +CreateZ3ConstraintManager