Reid Kleckner | 1a711b1 | 2014-07-22 00:53:05 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s -triple x86_64-pc-win32 |
Charles Li | 85dec55 | 2015-12-10 01:07:17 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions -std=c++98 %s -triple x86_64-pc-win32 |
| 3 | // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions -std=c++11 %s -triple x86_64-pc-win32 |
David Majnemer | ad2986e | 2014-08-14 06:35:08 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s -triple i386-apple-darwin13.3.0 |
Charles Li | 85dec55 | 2015-12-10 01:07:17 +0000 | [diff] [blame] | 5 | // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions -std=c++98 %s -triple i386-apple-darwin13.3.0 |
| 6 | // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions -std=c++11 %s -triple i386-apple-darwin13.3.0 |
Reid Kleckner | 1a711b1 | 2014-07-22 00:53:05 +0000 | [diff] [blame] | 7 | |
David Majnemer | ad2986e | 2014-08-14 06:35:08 +0000 | [diff] [blame] | 8 | #ifndef __APPLE__ |
Reid Kleckner | 1a711b1 | 2014-07-22 00:53:05 +0000 | [diff] [blame] | 9 | #pragma init_seg(L".my_seg") // expected-warning {{expected 'compiler', 'lib', 'user', or a string literal}} |
| 10 | #pragma init_seg( // expected-warning {{expected 'compiler', 'lib', 'user', or a string literal}} |
| 11 | #pragma init_seg asdf // expected-warning {{missing '('}} |
| 12 | #pragma init_seg) // expected-warning {{missing '('}} |
| 13 | #pragma init_seg("a" "b") // no warning |
| 14 | #pragma init_seg("a", "b") // expected-warning {{missing ')'}} |
| 15 | #pragma init_seg("a") asdf // expected-warning {{extra tokens at end of '#pragma init_seg'}} |
| 16 | #pragma init_seg("\x") // expected-error {{\x used with no following hex digits}} |
| 17 | #pragma init_seg("a" L"b") // expected-warning {{expected non-wide string literal in '#pragma init_seg'}} |
| 18 | |
Reid Kleckner | 1a711b1 | 2014-07-22 00:53:05 +0000 | [diff] [blame] | 19 | #pragma init_seg(compiler) |
David Majnemer | ad2986e | 2014-08-14 06:35:08 +0000 | [diff] [blame] | 20 | #else |
| 21 | #pragma init_seg(compiler) // expected-warning {{'#pragma init_seg' is only supported when targeting a Microsoft environment}} |
| 22 | #endif |
| 23 | |
| 24 | int f(); |
Reid Kleckner | 1a711b1 | 2014-07-22 00:53:05 +0000 | [diff] [blame] | 25 | int __declspec(thread) x = f(); // expected-error {{initializer for thread-local variable must be a constant expression}} |
Charles Li | 85dec55 | 2015-12-10 01:07:17 +0000 | [diff] [blame] | 26 | #if __cplusplus >= 201103L |
| 27 | // expected-note@-2 {{use 'thread_local' to allow this}} |
| 28 | #endif |