# This file is part of GNU cflow testsuite. -*- Autotest -*- # Copyright (C) 2006 Jerry St.Clair # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2, or (at # your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA. AT_SETUP([hiding of global and file static identifiers]) AT_KEYWORDS([hiding]) CFLOW_OPT([-ix_], [ CFLOW_CHECK([ static int s = 1; int g = -100; static int foo() { static int s = 10; /* hides file static variable */ return s; } static int bar() { static int foo = 100; /* hides file static function */ return foo + g; } int baz() { int g = 100; /* hides global variable */ return s + g; } int main() { return (g + s + foo() + bar() + baz()); } ], [main() : g s foo() : s bar() : foo g baz() : s ]) ]) AT_CLEANUP