tree decl = decl_reg->get_decl ();
if (TREE_CODE (decl) != VAR_DECL)
return;
+ /* For now, don't emit the status of decls in the constant pool, to avoid
+ differences in DejaGnu test results between targets that use these vs
+ those that don't.
+ (Eventually these decls should probably be untracked and we should test
+ for that, but that's not stage 4 material). */
+ if (DECL_IN_CONSTANT_POOL (decl))
+ return;
warning_at (DECL_SOURCE_LOCATION (decl), 0,
"track %qD: %s",
decl, (decl_reg->tracked_p () ? "yes" : "no"));
/* { dg-additional-options "-fdump-analyzer-untracked" } */
+#include "analyzer-decls.h"
+
struct st
{
const char *m_filename;
extern_fn (&s3);
}
+void test_3a (void)
+{
+ struct st s3a = { "foo.c", 42 }; /* { dg-warning "track 's3a': yes" } */
+ __analyzer_eval (s3a.m_filename[0] == 'f'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (s3a.m_line == 42); /* { dg-warning "TRUE" } */
+ extern_fn (&s3a);
+ __analyzer_eval (s3a.m_filename[0] == 'f'); /* { dg-warning "UNKNOWN" } */
+ __analyzer_eval (s3a.m_line == 42); /* { dg-warning "UNKNOWN" } */
+}
+
extern void called_by_test_4 (int *);
int test_4 (void)
{
extern_fn_char_ptr (__func__); /* { dg-warning "track '__func__': no" } */
}
+
+char t14_global_unused[100]; /* { dg-warning "track 't14_global_unused': yes" } */
+static char t14_static_unused[100]; /* { dg-warning "track 't14_static_unused': yes" } */
+char t14_global_used[100]; /* { dg-warning "track 't14_global_used': yes" } */
+static char t14_static_used[100]; /* { dg-warning "track 't14_static_used': yes" } */
+void test_14 (void)
+{
+ extern_fn_char_ptr (t14_global_unused);
+ extern_fn_char_ptr (t14_static_unused);
+ extern_fn_char_ptr (t14_global_used);
+ __analyzer_eval (t14_global_used[0] == '\0'); /* { dg-warning "UNKNOWN" } */
+ extern_fn_char_ptr (t14_static_used);
+ __analyzer_eval (t14_static_used[0] == '\0'); /* { dg-warning "UNKNOWN" } */
+}