+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
+++ /dev/null
-// 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);
-}
--- /dev/null
+/* { 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);
+}