clang/test/Sema/err-decl-block-extern-no-init.c
raw| 1 | // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s |
| 2 | static int x; |
| 3 | |
| 4 | void foo(void) |
| 5 | { |
| 6 | extern int x = 1; // expected-error {{declaration of block scope identifier with linkage cannot have an initializer}} |
| 7 | } |
| 8 | |
| 9 | int y; |
| 10 | |
| 11 | void bar(void) |
| 12 | { |
| 13 | extern int y = 1; // expected-error {{declaration of block scope identifier with linkage cannot have an initializer}} |
| 14 | |
| 15 | } |