1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s -triple x86_64-pc-win32
2*0a6a1f1dSLionel Sambuc
3*0a6a1f1dSLionel Sambuc #pragma const_seg(".my_const") // expected-note 2 {{#pragma entered here}}
4*0a6a1f1dSLionel Sambuc extern const int a;
5*0a6a1f1dSLionel Sambuc const int a = 1; // expected-note 2 {{declared here}}
6*0a6a1f1dSLionel Sambuc #pragma data_seg(".my_const") // expected-note {{#pragma entered here}}
7*0a6a1f1dSLionel Sambuc int b = 1; // expected-error {{'b' causes a section type conflict with 'a'}}
8*0a6a1f1dSLionel Sambuc #pragma data_seg()
9*0a6a1f1dSLionel Sambuc int c = 1;
10*0a6a1f1dSLionel Sambuc __declspec(allocate(".my_const")) int d = 1; // expected-error {{'d' causes a section type conflict with 'a'}}
11*0a6a1f1dSLionel Sambuc #pragma data_seg("\u") // expected-error {{\u used with no following hex digits}}
12*0a6a1f1dSLionel Sambuc #pragma data_seg("a" L"b") // expected-warning {{expected non-wide string literal in '#pragma data_seg'}}
13*0a6a1f1dSLionel Sambuc
14*0a6a1f1dSLionel Sambuc #pragma section(".my_seg", execute) // expected-note 2 {{#pragma entered her}}
15*0a6a1f1dSLionel Sambuc __declspec(allocate(".my_seg")) int int_my_seg;
16*0a6a1f1dSLionel Sambuc #pragma code_seg(".my_seg")
fn_my_seg(void)17*0a6a1f1dSLionel Sambuc void fn_my_seg(void){}
18*0a6a1f1dSLionel Sambuc
19*0a6a1f1dSLionel Sambuc __declspec(allocate(".bad_seg")) int int_bad_seg = 1; // expected-note {{declared here}}
20*0a6a1f1dSLionel Sambuc #pragma code_seg(".bad_seg") // expected-note {{#pragma entered here}}
fn_bad_seg(void)21*0a6a1f1dSLionel Sambuc void fn_bad_seg(void){} // expected-error {{'fn_bad_seg' causes a section type conflict with 'int_bad_seg'}}
22*0a6a1f1dSLionel Sambuc
23*0a6a1f1dSLionel Sambuc #pragma bss_seg // expected-warning {{missing '(' after '#pragma bss_seg' - ignoring}}
24*0a6a1f1dSLionel Sambuc #pragma bss_seg(L".my_seg") // expected-warning {{expected push, pop or a string literal for the section name in '#pragma bss_seg' - ignored}}
25*0a6a1f1dSLionel Sambuc #pragma bss_seg(1) // expected-warning {{expected push, pop or a string literal for the section name in '#pragma bss_seg' - ignored}}
26*0a6a1f1dSLionel Sambuc #pragma bss_seg(push)
27*0a6a1f1dSLionel Sambuc #pragma bss_seg(push, ".my_seg")
28*0a6a1f1dSLionel Sambuc #pragma bss_seg(push, 1) // expected-warning {{expected a stack label or a string literal for the section name in '#pragma bss_seg'}}
29*0a6a1f1dSLionel Sambuc #pragma bss_seg ".my_seg" // expected-warning {{missing '(' after '#pragma bss_seg' - ignoring}}
30*0a6a1f1dSLionel Sambuc #pragma bss_seg(push, my_label, 1) // expected-warning {{expected a string literal for the section name in '#pragma bss_seg' - ignored}}
31*0a6a1f1dSLionel Sambuc #pragma bss_seg(".my_seg", 1) // expected-warning {{missing ')' after '#pragma bss_seg' - ignoring}}
32*0a6a1f1dSLionel Sambuc #pragma bss_seg(".my_seg" // expected-warning {{missing ')' after '#pragma bss_seg' - ignoring}}
33*0a6a1f1dSLionel Sambuc
34*0a6a1f1dSLionel Sambuc #pragma section // expected-warning {{missing '(' after '#pragma section' - ignoring}}
35*0a6a1f1dSLionel Sambuc #pragma section( // expected-warning {{expected a string literal for the section name in '#pragma section' - ignored}}
36*0a6a1f1dSLionel Sambuc #pragma section(L".my_seg") // expected-warning {{expected a string literal for the section name in '#pragma section' - ignored}}
37*0a6a1f1dSLionel Sambuc #pragma section(".my_seg" // expected-warning {{missing ')' after '#pragma section' - ignoring}}
38*0a6a1f1dSLionel Sambuc #pragma section(".my_seg" 1 // expected-warning {{missing ')' after '#pragma section' - ignoring}}
39*0a6a1f1dSLionel Sambuc #pragma section(".my_seg", // expected-warning {{expected action or ')' in '#pragma section' - ignored}}
40*0a6a1f1dSLionel Sambuc #pragma section(".my_seg", read) // expected-error {{this causes a section type conflict with a prior #pragma section}}
41*0a6a1f1dSLionel Sambuc #pragma section(".my_seg", bogus) // expected-warning {{unknown action 'bogus' for '#pragma section' - ignored}}
42*0a6a1f1dSLionel Sambuc #pragma section(".my_seg", nopage) // expected-warning {{known but unsupported action 'nopage' for '#pragma section' - ignored}}
43*0a6a1f1dSLionel Sambuc #pragma section(".my_seg", read, write) // expected-error {{this causes a section type conflict with a prior #pragma section}}
44*0a6a1f1dSLionel Sambuc #pragma section(".my_seg", read, write, 1) // expected-warning {{expected action or ')' in '#pragma section' - ignored}}
45