diff options
Diffstat (limited to 'test/Sema/ms-keyword-system-header.c')
-rw-r--r-- | test/Sema/ms-keyword-system-header.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Sema/ms-keyword-system-header.c b/test/Sema/ms-keyword-system-header.c new file mode 100644 index 0000000..b4ff568 --- /dev/null +++ b/test/Sema/ms-keyword-system-header.c @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -fms-extensions -D MS -isystem %S/Inputs %s -fsyntax-only -verify +// RUN: %clang_cc1 -fms-extensions -D MS -Wno-keyword-compat -I %S/Inputs %s -fsyntax-only -verify +// RUN: %clang_cc1 -fms-extensions -D MS -D NOT_SYSTEM -I %S/Inputs %s -fsyntax-only -verify +// RUN: %clang_cc1 -isystem %S/Inputs %s -fsyntax-only -verify + +// PR17824: GNU libc uses MS keyword __uptr as an identifier in C mode +#include <ms-keyword-system-header.h> + +void fn() { + WS ws; + ws.__uptr = 0; +#ifdef MS + // expected-error@-2 {{expected identifier}} +#else + // expected-no-diagnostics +#endif +} |