summaryrefslogtreecommitdiffstats
path: root/test/Analysis/new-with-exceptions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/new-with-exceptions.cpp')
-rw-r--r--test/Analysis/new-with-exceptions.cpp32
1 files changed, 7 insertions, 25 deletions
diff --git a/test/Analysis/new-with-exceptions.cpp b/test/Analysis/new-with-exceptions.cpp
index d909f1f..84d77c2 100644
--- a/test/Analysis/new-with-exceptions.cpp
+++ b/test/Analysis/new-with-exceptions.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store region -std=c++11 -fexceptions -fcxx-exceptions -verify -DEXCEPTIONS %s
+// 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
void clang_analyzer_eval(bool);
@@ -32,33 +32,15 @@ void testNew() {
clang_analyzer_eval(new NoThrow); // expected-warning{{UNKNOWN}}
clang_analyzer_eval(new NoExcept); // expected-warning{{UNKNOWN}}
- clang_analyzer_eval(new DefaultThrow);
- clang_analyzer_eval(new ExplicitThrow);
-#ifdef EXCEPTIONS
- // expected-warning@-3 {{TRUE}}
- // expected-warning@-3 {{TRUE}}
-#else
- // expected-warning@-6 {{UNKNOWN}}
- // expected-warning@-6 {{UNKNOWN}}
-#endif
+ clang_analyzer_eval(new DefaultThrow); // expected-warning{{TRUE}}
+ clang_analyzer_eval(new ExplicitThrow); // expected-warning{{TRUE}}
}
void testNewArray() {
- clang_analyzer_eval(new NoThrow[2]);
- clang_analyzer_eval(new NoExcept[2]);
- clang_analyzer_eval(new DefaultThrow[2]);
- clang_analyzer_eval(new ExplicitThrow[2]);
-#ifdef EXCEPTIONS
- // expected-warning@-5 {{TRUE}}
- // expected-warning@-5 {{TRUE}}
- // expected-warning@-5 {{TRUE}}
- // expected-warning@-5 {{TRUE}}
-#else
- // expected-warning@-10 {{UNKNOWN}}
- // expected-warning@-10 {{UNKNOWN}}
- // expected-warning@-10 {{UNKNOWN}}
- // expected-warning@-10 {{UNKNOWN}}
-#endif
+ clang_analyzer_eval(new NoThrow[2]); // expected-warning{{TRUE}}
+ clang_analyzer_eval(new NoExcept[2]); // expected-warning{{TRUE}}
+ clang_analyzer_eval(new DefaultThrow[2]); // expected-warning{{TRUE}}
+ clang_analyzer_eval(new ExplicitThrow[2]); // expected-warning{{TRUE}}
}
extern void *operator new[](size_t, int) noexcept;
OpenPOWER on IntegriCloud