Skip to content

Commit

Permalink
[analyzer] Specify the C++ standard in more tests.
Browse files Browse the repository at this point in the history
Makes life easier for downstream developers with different default standard.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375308 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
haoNoQ committed Oct 19, 2019
1 parent 05441b0 commit e0c6af7
Show file tree
Hide file tree
Showing 29 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion test/Analysis/cast-value-logic.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 \
// RUN: %clang_analyze_cc1 -std=c++14 \
// RUN: -analyzer-checker=core,apiModeling.llvm.CastValue,debug.ExprInspection\
// RUN: -verify %s

Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/cast-value-notes.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 \
// RUN: %clang_analyze_cc1 -std=c++14 \
// RUN: -analyzer-checker=core,apiModeling.llvm.CastValue,debug.ExprInspection\
// RUN: -analyzer-output=text -verify %s

Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/cast-value-state-dump.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 \
// RUN: %clang_analyze_cc1 -std=c++14 \
// RUN: -analyzer-checker=core,apiModeling.llvm.CastValue,debug.ExprInspection\
// RUN: -analyzer-output=text -verify %s 2>&1 | FileCheck %s

Expand Down
4 changes: 2 additions & 2 deletions test/Analysis/ctu-different-triples.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// RUN: rm -rf %t && mkdir %t
// RUN: mkdir -p %t/ctudir
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu \
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
// RUN: -emit-pch -o %t/ctudir/ctu-other.cpp.ast %S/Inputs/ctu-other.cpp
// RUN: cp %S/Inputs/ctu-other.cpp.externalDefMap.txt %t/ctudir/externalDefMap.txt
// RUN: %clang_analyze_cc1 -triple powerpc64-montavista-linux-gnu \
// RUN: %clang_analyze_cc1 -std=c++14 -triple powerpc64-montavista-linux-gnu \
// RUN: -analyzer-checker=core,debug.ExprInspection \
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
// RUN: -analyzer-config ctu-dir=%t/ctudir \
Expand Down
8 changes: 4 additions & 4 deletions test/Analysis/ctu-main.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// RUN: rm -rf %t && mkdir %t
// RUN: mkdir -p %t/ctudir
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu \
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
// RUN: -emit-pch -o %t/ctudir/ctu-other.cpp.ast %S/Inputs/ctu-other.cpp
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu \
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
// RUN: -emit-pch -o %t/ctudir/ctu-chain.cpp.ast %S/Inputs/ctu-chain.cpp
// RUN: cp %S/Inputs/ctu-other.cpp.externalDefMap.txt %t/ctudir/externalDefMap.txt
// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu \
// RUN: %clang_analyze_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
// RUN: -analyzer-checker=core,debug.ExprInspection \
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
// RUN: -analyzer-config ctu-dir=%t/ctudir \
// RUN: -verify %s
// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu \
// RUN: %clang_analyze_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
// RUN: -analyzer-checker=core,debug.ExprInspection \
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
// RUN: -analyzer-config ctu-dir=%t/ctudir \
Expand Down
4 changes: 2 additions & 2 deletions test/Analysis/ctu-unknown-parts-in-triples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

// RUN: rm -rf %t && mkdir %t
// RUN: mkdir -p %t/ctudir
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu \
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
// RUN: -emit-pch -o %t/ctudir/ctu-other.cpp.ast %S/Inputs/ctu-other.cpp
// RUN: cp %S/Inputs/ctu-other.cpp.externalDefMap.txt %t/ctudir/externalDefMap.txt
// RUN: %clang_analyze_cc1 -triple x86_64-unknown-linux-gnu \
// RUN: %clang_analyze_cc1 -std=c++14 -triple x86_64-unknown-linux-gnu \
// RUN: -analyzer-checker=core,debug.ExprInspection \
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
// RUN: -analyzer-config ctu-dir=%t/ctudir \
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/deadstores-driverkit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// It needs to be on the top.
// Run-lines can wait.

// RUN: %clang_analyze_cc1 -w -triple x86_64-apple-driverkit19.0 \
// RUN: %clang_analyze_cc1 -std=c++17 -w -triple x86_64-apple-driverkit19.0 \
// RUN: -analyzer-checker=deadcode -verify %s

// expected-no-diagnostics
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/diagnostics/dtors.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 -w -analyzer-checker=core,cplusplus -analyzer-output=text -verify %s
// RUN: %clang_analyze_cc1 -std=c++14 -w -analyzer-checker=core,cplusplus -analyzer-output=text -verify %s

namespace no_crash_on_delete_dtor {
// We were crashing when producing diagnostics for this code, but not for the
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/domtest.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 %s \
// RUN: %clang_analyze_cc1 -std=c++14 %s \
// RUN: -analyzer-checker=debug.DumpDominators \
// RUN: -analyzer-checker=debug.DumpPostDominators \
// RUN: -analyzer-checker=debug.DumpControlDependencies \
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/explain-svals.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=core.builtin,debug.ExprInspection,unix.cstring -verify %s
// RUN: %clang_analyze_cc1 -std=c++14 -triple i386-apple-darwin10 -analyzer-checker=core.builtin,debug.ExprInspection,unix.cstring -verify %s

typedef unsigned long size_t;

Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/initialization.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core.builtin,debug.ExprInspection -verify %s
// RUN: %clang_cc1 -std=c++14 -triple i386-apple-darwin10 -analyze -analyzer-checker=core.builtin,debug.ExprInspection -verify %s

void clang_analyzer_eval(int);

Expand Down
4 changes: 2 additions & 2 deletions test/Analysis/inlining/placement-new-fp-suppression.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// RUN: %clang_analyze_cc1 \
// RUN: %clang_analyze_cc1 -std=c++14 \
// RUN: -analyzer-checker=core.CallAndMessage \
// RUN: -analyzer-config suppress-null-return-paths=false \
// RUN: -verify %s
// RUN: %clang_analyze_cc1 \
// RUN: %clang_analyze_cc1 -std=c++14 \
// RUN: -analyzer-checker=core.CallAndMessage \
// RUN: -DSUPPRESSED \
// RUN: -verify %s
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/inner-pointer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.InnerPointer \
// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=cplusplus.InnerPointer \
// RUN: -Wno-dangling -Wno-dangling-field -Wno-return-stack-address \
// RUN: %s -analyzer-output=text -verify

Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/malloc.mm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify -fblocks %s
// RUN: %clang_analyze_cc1 -std=c++14 -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"

Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/mig.mm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 -w -analyzer-checker=core,osx.MIG\
// RUN: %clang_analyze_cc1 -w -analyzer-checker=core,osx.MIG -std=c++14 \
// RUN: -analyzer-output=text -fblocks -verify %s

typedef unsigned uint32_t;
Expand Down
4 changes: 2 additions & 2 deletions test/Analysis/new-ctor-null-throw.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core \
// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core \
// RUN: -analyzer-config suppress-null-return-paths=false \
// RUN: -verify %s
// RUN: %clang_analyze_cc1 -analyzer-checker=core \
// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core \
// RUN: -DSUPPRESSED \
// RUN: -verify %s

Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/new-ctor-null.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 \
// RUN: %clang_analyze_cc1 -std=c++14 \
// RUN: -analyzer-checker=core,debug.ExprInspection \
// RUN: -verify %s

Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/osobject-retain-release.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 -fblocks -analyze -analyzer-output=text\
// RUN: %clang_analyze_cc1 -std=c++14 -fblocks -analyze -analyzer-output=text\
// RUN: -analyzer-checker=core,osx,debug.ExprInspection -verify %s

#include "os_object_base.h"
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/osobjectcstylecastchecker_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=optin.osx.OSObjectCStyleCast %s -verify
// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=optin.osx.OSObjectCStyleCast %s -verify
#include "os_object_base.h"

struct OSArray : public OSObject {
Expand Down
4 changes: 2 additions & 2 deletions test/Analysis/plist-macros-with-expansion.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core -verify %s
//
// RUN: %clang_analyze_cc1 -analyzer-checker=core %s \
// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core %s \
// RUN: -analyzer-output=plist -o %t.plist \
// RUN: -analyzer-config expand-macros=true
//
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/ptr-iter.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 %s -analyzer-output=text -verify \
// RUN: %clang_analyze_cc1 %s -std=c++14 -analyzer-output=text -verify \
// RUN: -analyzer-checker=core,alpha.nondeterminism.PointerIteration

#include "Inputs/system-header-simulator-cxx.h"
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/ptr-sort.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 %s -analyzer-output=text -verify \
// RUN: %clang_analyze_cc1 %s -std=c++14 -analyzer-output=text -verify \
// RUN: -analyzer-checker=core,alpha.nondeterminism.PointerSorting

#include "Inputs/system-header-simulator-cxx.h"
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/rvo.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 -analyzer-checker core,cplusplus \
// RUN: %clang_analyze_cc1 -analyzer-checker core,cplusplus -std=c++14 \
// RUN: -analyzer-checker debug.ExprInspection -verify %s

void clang_analyzer_eval(bool);
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/sizeofpack.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection \
// RUN: -verify %s
// RUN: -std=c++14 -verify %s

typedef __typeof(sizeof(int)) size_t;

Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/stack-frame-context-revision.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core,cplusplus.NewDelete -verify %s
// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core,cplusplus.NewDelete -verify %s

// expected-no-diagnostics:
// From now the profile of the 'StackFrameContext' also contains the
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/temporaries.mm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 -analyzer-checker core,cplusplus -verify %s
// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker core,cplusplus -verify %s

// expected-no-diagnostics

Expand Down
6 changes: 3 additions & 3 deletions test/Analysis/test-separate-retaincount.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// RUN: %clang_analyze_cc1 -DNO_CF_OBJECT -verify %s \
// RUN: %clang_analyze_cc1 -std=c++14 -DNO_CF_OBJECT -verify %s \
// RUN: -analyzer-checker=core,osx \
// RUN: -analyzer-disable-checker osx.cocoa.RetainCount
//
// RUN: %clang_analyze_cc1 -DNO_OS_OBJECT -verify %s \
// RUN: %clang_analyze_cc1 -std=c++14 -DNO_OS_OBJECT -verify %s \
// RUN: -analyzer-checker=core,osx \
// RUN: -analyzer-disable-checker osx.OSObjectRetainCount
//
// RUN: %clang_analyze_cc1 -DNO_OS_OBJECT -verify %s \
// RUN: %clang_analyze_cc1 -std=c++14 -DNO_OS_OBJECT -verify %s \
// RUN: -analyzer-checker=core,osx \
// RUN: -analyzer-config "osx.cocoa.RetainCount:CheckOSObject=false"

Expand Down
8 changes: 4 additions & 4 deletions test/Analysis/track-control-dependency-conditions.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// RUN: %clang_analyze_cc1 %s \
// RUN: %clang_analyze_cc1 %s -std=c++14 \
// RUN: -verify=expected,tracking \
// RUN: -analyzer-config track-conditions=true \
// RUN: -analyzer-output=text \
// RUN: -analyzer-checker=core

// RUN: not %clang_analyze_cc1 -verify %s \
// RUN: not %clang_analyze_cc1 -std=c++14 -verify %s \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-config track-conditions=false \
// RUN: -analyzer-config track-conditions-debug=true \
Expand All @@ -14,14 +14,14 @@
// CHECK-INVALID-DEBUG-SAME: 'track-conditions-debug', that expects
// CHECK-INVALID-DEBUG-SAME: 'track-conditions' to also be enabled
//
// RUN: %clang_analyze_cc1 %s \
// RUN: %clang_analyze_cc1 %s -std=c++14 \
// RUN: -verify=expected,tracking,debug \
// RUN: -analyzer-config track-conditions=true \
// RUN: -analyzer-config track-conditions-debug=true \
// RUN: -analyzer-output=text \
// RUN: -analyzer-checker=core

// RUN: %clang_analyze_cc1 %s -verify \
// RUN: %clang_analyze_cc1 %s -std=c++14 -verify \
// RUN: -analyzer-output=text \
// RUN: -analyzer-config track-conditions=false \
// RUN: -analyzer-checker=core
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/unions.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,debug.ExprInspection %s -analyzer-config eagerly-assume=false -verify
// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core,unix.Malloc,debug.ExprInspection %s -analyzer-config eagerly-assume=false -verify

extern void clang_analyzer_eval(bool);
extern void clang_analyzer_warnIfReached();
Expand Down

0 comments on commit e0c6af7

Please sign in to comment.