blob: f75c140be16c4c1644d5bf3ee1308956fa42ba56 [file] [log] [blame]
John McCall9a8cb8d2010-03-16 21:50:59 +00001// RUN: %clang_cc1 -verify -fsyntax-only -Wshadow %s
2
3int i; // expected-note {{previous declaration is here}}
4
5void foo() {
6 int pass1;
7 int i; // expected-warning {{declaration shadows a variable in the global scope}} \
8 // expected-note {{previous declaration is here}}
9 {
10 int pass2;
11 int i; // expected-warning {{declaration shadows a local variable}} \
12 // expected-note {{previous declaration is here}}
13 {
14 int pass3;
15 int i; // expected-warning {{declaration shadows a local variable}}
16 }
17 }
18
19 int __sync_fetch_and_add; // expected-warning {{declaration shadows a global built-in function}}
20}