From: David Malcolm Date: Thu, 30 Jan 2020 19:57:34 +0000 (-0500) Subject: analyzer: convert conditionals-2.c to a torture test X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e34ad101a4338eab41e38e624f2c7178d0b83d24;p=gcc.git analyzer: convert conditionals-2.c to a torture test 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. --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 621d4283ae3..77dcc013b3f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2020-01-30 David Malcolm + + * 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 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 index 6f291f4861b..00000000000 --- a/gcc/testsuite/gcc.dg/analyzer/conditionals-2.c +++ /dev/null @@ -1,45 +0,0 @@ -// TODO: run this test case at every optimization level -/* { dg-additional-options "-O2" } */ - -#include -#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 index 00000000000..5580d22ab92 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/torture/conditionals-2.c @@ -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); +}