analyzer: convert conditionals-2.c to a torture test
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 30 Jan 2020 19:57:34 +0000 (14:57 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 31 Jan 2020 00:08:48 +0000 (19:08 -0500)
gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/conditionals-2.c: Move to...
* gcc.dg/analyzer/torture/conditionals-2.c: ...here, converting
to a torture test.  Remove redundant include.

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/analyzer/conditionals-2.c [deleted file]
gcc/testsuite/gcc.dg/analyzer/torture/conditionals-2.c [new file with mode: 0644]

index 621d4283ae3c15f1ece6519bcd52ae571bc93dfb..77dcc013b3f59868fa43161d1c05b19f977a9a37 100644 (file)
@@ -1,3 +1,9 @@
+2020-01-30  David Malcolm  <dmalcolm@redhat.com>
+
+       * gcc.dg/analyzer/conditionals-2.c: Move to...
+       * gcc.dg/analyzer/torture/conditionals-2.c: ...here, converting
+       to a torture test.  Remove redundant include.
+
 2020-01-30  David Malcolm  <dmalcolm@redhat.com>
 
        PR analyzer/93356
diff --git a/gcc/testsuite/gcc.dg/analyzer/conditionals-2.c b/gcc/testsuite/gcc.dg/analyzer/conditionals-2.c
deleted file mode 100644 (file)
index 6f291f4..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// TODO: run this test case at every optimization level
-/* { dg-additional-options "-O2" } */
-
-#include <stddef.h>
-#include "analyzer-decls.h"
-
-#define Z_NULL 0
-
-static void __attribute__((noinline))
-test_1_callee (void *p, void *q)
-{
-  __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
-
-  __analyzer_eval (p == Z_NULL); /* { dg-warning "FALSE" } */
-  __analyzer_eval (p != Z_NULL); /* { dg-warning "TRUE" } */
-
-  __analyzer_eval (q == Z_NULL); /* { dg-warning "FALSE" } */ 
-  __analyzer_eval (q != Z_NULL); /* { dg-warning "TRUE" } */ 
-}
-
-void test_1 (void *p, void *q)
-{
-  if (p == Z_NULL || q == Z_NULL)
-    return;
-
-  test_1_callee (p, q);
-}
-
-static void __attribute__((noinline))
-test_2_callee (void *p, void *q)
-{
-  __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
-
-  __analyzer_eval (p == Z_NULL); /* { dg-warning "FALSE" } */
-  __analyzer_eval (p != Z_NULL); /* { dg-warning "TRUE" } */
-
-  __analyzer_eval (q == Z_NULL); /* { dg-warning "FALSE" } */ 
-  __analyzer_eval (q != Z_NULL); /* { dg-warning "TRUE" } */ 
-}
-
-void test_2 (void *p, void *q)
-{
-  if (p != Z_NULL && q != Z_NULL)
-    test_2_callee (p, q);
-}
diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/conditionals-2.c b/gcc/testsuite/gcc.dg/analyzer/torture/conditionals-2.c
new file mode 100644 (file)
index 0000000..5580d22
--- /dev/null
@@ -0,0 +1,43 @@
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+
+#include "../analyzer-decls.h"
+
+#define Z_NULL 0
+
+static void __attribute__((noinline))
+test_1_callee (void *p, void *q)
+{
+  __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+
+  __analyzer_eval (p == Z_NULL); /* { dg-warning "FALSE" } */
+  __analyzer_eval (p != Z_NULL); /* { dg-warning "TRUE" } */
+
+  __analyzer_eval (q == Z_NULL); /* { dg-warning "FALSE" } */ 
+  __analyzer_eval (q != Z_NULL); /* { dg-warning "TRUE" } */ 
+}
+
+void test_1 (void *p, void *q)
+{
+  if (p == Z_NULL || q == Z_NULL)
+    return;
+
+  test_1_callee (p, q);
+}
+
+static void __attribute__((noinline))
+test_2_callee (void *p, void *q)
+{
+  __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */
+
+  __analyzer_eval (p == Z_NULL); /* { dg-warning "FALSE" } */
+  __analyzer_eval (p != Z_NULL); /* { dg-warning "TRUE" } */
+
+  __analyzer_eval (q == Z_NULL); /* { dg-warning "FALSE" } */ 
+  __analyzer_eval (q != Z_NULL); /* { dg-warning "TRUE" } */ 
+}
+
+void test_2 (void *p, void *q)
+{
+  if (p != Z_NULL && q != Z_NULL)
+    test_2_callee (p, q);
+}