summaryrefslogtreecommitdiffstats
path: root/clang/tools/scan-build-py/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'clang/tools/scan-build-py/tests/unit')
-rw-r--r--clang/tools/scan-build-py/tests/unit/test_runner.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/tools/scan-build-py/tests/unit/test_runner.py b/clang/tools/scan-build-py/tests/unit/test_runner.py
index ea10051d850..de15d236920 100644
--- a/clang/tools/scan-build-py/tests/unit/test_runner.py
+++ b/clang/tools/scan-build-py/tests/unit/test_runner.py
@@ -211,3 +211,14 @@ class RequireDecoratorTest(unittest.TestCase):
def test_method_exception_not_caught(self):
self.assertRaises(Exception, method_exception_from_inside, dict())
+
+class ForceAnalyzeDebugTest(unittest.TestCase):
+
+ def test_force_analyze_debug_code(self):
+ for a, b in [
+ ([], ['-UNDEBUG']),
+ (['-O2'], ['-O2', '-UNDEBUG']),
+ (['-Dkey=val'], ['-Dkey=val', '-UNDEBUG']),
+ (['-D', 'NDEBUG'], ['-D', 'NDEBUG', '-UNDEBUG']) ]:
+ sut.force_analyze_debug_code(a)
+ self.assertEqual(a, b)
OpenPOWER on IntegriCloud