summaryrefslogtreecommitdiffstats
path: root/test/Analysis/inlining/false-positive-suppression.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/inlining/false-positive-suppression.c')
-rw-r--r--test/Analysis/inlining/false-positive-suppression.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Analysis/inlining/false-positive-suppression.c b/test/Analysis/inlining/false-positive-suppression.c
index c5c6bb8..e1c8f67 100644
--- a/test/Analysis/inlining/false-positive-suppression.c
+++ b/test/Analysis/inlining/false-positive-suppression.c
@@ -84,6 +84,14 @@ void testMultipleStore(void *p) {
#endif
}
+// Test that div by zero does not get suppressed. This is a policy choice.
+int retZero() {
+ return 0;
+}
+int triggerDivZero () {
+ int y = retZero();
+ return 5/y; // expected-warning {{Division by zero}}
+}
// --------------------------
// "Suppression suppression"
OpenPOWER on IntegriCloud