blob: 7e5740b483085db42cbbf94ada524a606675086a [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Eli Friedman8df74622009-06-05 00:50:43 +00002
3// Note that this puts the expected lines before the directives to work around
4// limitations in the -verify mode.
5
6int x;
7/* expected-warning {{expected identifier in '#pragma weak'}}*/ #pragma weak
8#pragma weak x
Eli Friedman8df74622009-06-05 00:50:43 +00009
Eli Friedman3c1291d2009-06-05 02:49:06 +000010extern int z;
Eli Friedman8df74622009-06-05 00:50:43 +000011/* expected-warning {{expected identifier in '#pragma weak'}}*/ #pragma weak z = =
12/* expected-warning {{expected identifier in '#pragma weak'}}*/ #pragma weak z =
Ryan Flynn7d470f32009-07-30 03:15:39 +000013/* expected-warning {{weak identifier 'y' never declared}} */ #pragma weak z = y
Eli Friedman8df74622009-06-05 00:50:43 +000014
Eli Friedman3c1291d2009-06-05 02:49:06 +000015extern int a;
Eli Friedman8df74622009-06-05 00:50:43 +000016/* expected-warning {{extra tokens at end of '#pragma weak'}}*/ #pragma weak a b
17/* expected-warning {{extra tokens at end of '#pragma weak'}}*/ #pragma weak a = x c