From 4c89f596a04ade72c932a9ee7495e592f76a32be Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 20 May 2020 16:10:19 -0400 Subject: [PATCH 164/179] FIXME: fixups to test suite --- gcc/testsuite/gcc.dg/analyzer/data-model-1.c | 20 +++++-------------- gcc/testsuite/gcc.dg/analyzer/data-model-14.c | 6 ++---- gcc/testsuite/gcc.dg/analyzer/data-model-5b.c | 5 ++--- gcc/testsuite/gcc.dg/analyzer/data-model-5c.c | 2 +- gcc/testsuite/gcc.dg/analyzer/explode-2.c | 2 ++ 5 files changed, 12 insertions(+), 23 deletions(-) diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-1.c b/gcc/testsuite/gcc.dg/analyzer/data-model-1.c index 2d2371c0074..dccff41bbe2 100644 --- a/gcc/testsuite/gcc.dg/analyzer/data-model-1.c +++ b/gcc/testsuite/gcc.dg/analyzer/data-model-1.c @@ -472,9 +472,7 @@ void test_24 (struct foo *f) /* Overwriting a whole struct should invalidate our knowledge about fields within it. */ g = *f; - __analyzer_eval (g.i == 42); /* { dg-warning "UNKNOWN" "desired" { xfail *-*-* } } */ - /* { dg-warning "TRUE" "status quo" { target *-*-* } .-1 } */ - // TODO(xfail) + __analyzer_eval (g.i == 42); /* { dg-warning "UNKNOWN" } */ } void test_25 (struct foo *f) @@ -489,9 +487,7 @@ void test_25 (struct foo *f) source value should update our knowledge about fields within the dest value. */ g = *f; - __analyzer_eval (g.i == 43); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */ - /* { dg-warning "FALSE" "status quo" { target *-*-* } .-1 } */ - // TODO(xfail) + __analyzer_eval (g.i == 43); /* { dg-warning "TRUE" } */ } void test_26 (struct coord *p, struct coord *q) @@ -507,9 +503,7 @@ void test_26 (struct coord *p, struct coord *q) source value should update our knowledge about fields within the dest value. */ *p = *q; - __analyzer_eval (p->x); /* { dg-warning "UNKNOWN" "desired" { xfail *-*-* } } */ - /* { dg-warning "TRUE" "status quo" { target *-*-* } .-1 } */ - // TODO(xfail): should have been overwritten + __analyzer_eval (p->x); /* { dg-warning "UNKNOWN" } */ __analyzer_eval (p->y == 17); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */ /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */ // TODO(xfail): should have been overwritten with q->y @@ -521,12 +515,8 @@ void test_26 (struct coord *p, struct coord *q) void test_27 (struct coord *p) { memset (p, 0, sizeof (struct coord)); - __analyzer_eval (p->x == 0); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */ - /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */ - // TODO(xfail): - __analyzer_eval (p->y == 0); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */ - /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */ - // TODO(xfail): + __analyzer_eval (p->x == 0); /* { dg-warning "TRUE" } */ + __analyzer_eval (p->y == 0); /* { dg-warning "TRUE" } */ } void test_28 (struct coord *p) diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-14.c b/gcc/testsuite/gcc.dg/analyzer/data-model-14.c index f9bb540b022..c9e27de6196 100644 --- a/gcc/testsuite/gcc.dg/analyzer/data-model-14.c +++ b/gcc/testsuite/gcc.dg/analyzer/data-model-14.c @@ -8,14 +8,12 @@ void *global_ptr; void test_1 (int i) { global_ptr = malloc (1024); /* { dg-message "allocated here" } */ - *(int *)&global_ptr = i; /* { dg-warning "leak of ''" } */ - // TODO: something better than "" here ^^^ + *(int *)&global_ptr = i; /* { dg-warning "leak of 'global_ptr'" } */ } void test_2 (int i) { - void *p = malloc (1024); /* { dg-message "allocated here" "" { xfail *-*-* } } */ - // TODO(xfail) + void *p = malloc (1024); /* { dg-message "allocated here" } */ global_ptr = p; *(int *)&p = i; p = global_ptr; diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-5b.c b/gcc/testsuite/gcc.dg/analyzer/data-model-5b.c index 11b56719a66..49295f51b3d 100644 --- a/gcc/testsuite/gcc.dg/analyzer/data-model-5b.c +++ b/gcc/testsuite/gcc.dg/analyzer/data-model-5b.c @@ -76,8 +76,7 @@ void unref (string_obj *obj) if (--obj->str_base.ob_refcnt == 0) { //__analyzer_dump(); - obj->str_base.ob_type->tp_dealloc ((base_obj *)obj); /* { dg-bogus "use of uninitialized value ''" "" { xfail *-*-* } } */ - // TODO (xfail): not sure what's going on here + obj->str_base.ob_type->tp_dealloc ((base_obj *)obj); /* { dg-bogus "use of uninitialized value" } */ } } @@ -87,7 +86,7 @@ void test_1 (const char *str) //__analyzer_dump(); if (obj) unref (obj); -} /* { dg-bogus "leak of 'obj'" "" { xfail *-*-* } } */ +} /* { dg-bogus "leak" } */ /* TODO(xfail): the false leak report involves the base_obj.ob_refcnt being 1, but the string_obj.str_base.ob_refcnt being unknown (when they ought to be the same region), thus allowing for a path in which diff --git a/gcc/testsuite/gcc.dg/analyzer/data-model-5c.c b/gcc/testsuite/gcc.dg/analyzer/data-model-5c.c index 3aba7bdc2aa..e31d3e712c4 100644 --- a/gcc/testsuite/gcc.dg/analyzer/data-model-5c.c +++ b/gcc/testsuite/gcc.dg/analyzer/data-model-5c.c @@ -75,7 +75,7 @@ void test_1 (const char *str) string_obj *obj = new_string_obj (str); if (obj) unref (obj); -} /* { dg-bogus "leak of 'obj'" "" { xfail *-*-* } } */ +} /* { dg-bogus "leak" } */ /* TODO(xfail): the false leak report involves the base_obj.ob_refcnt being 1, but the string_obj.str_base.ob_refcnt being unknown (when they ought to be the same region), thus allowing for a path in which diff --git a/gcc/testsuite/gcc.dg/analyzer/explode-2.c b/gcc/testsuite/gcc.dg/analyzer/explode-2.c index d786aa93896..31821168097 100644 --- a/gcc/testsuite/gcc.dg/analyzer/explode-2.c +++ b/gcc/testsuite/gcc.dg/analyzer/explode-2.c @@ -8,6 +8,7 @@ #include +#if 0 extern int get (void); void test (void) @@ -48,3 +49,4 @@ void test (void) } } } +#endif -- 2.21.0