[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / clang / test / Parser / ms-if-exists.c
blob7dd20544a6b4d6ad3b633cac7bb72f5a346d79cd
1 // RUN: %clang_cc1 %s -fsyntax-only -Wmicrosoft -verify -fms-extensions
2 // expected-no-diagnostics
4 struct Type {
5 };
7 void test_if_exists_stmts() {
8 int b = 0;
9 __if_exists(Type) {
10 b++;
11 b++;
13 __if_exists(Type_not) {
14 this will not compile.
16 __if_not_exists(Type) {
17 this will not compile.
19 __if_not_exists(Type_not) {
20 b++;
21 b++;
25 int if_exists_creates_no_scope() {
26 __if_exists(Type) {
27 int x; // 'x' is declared in the parent scope.
29 __if_not_exists(Type_not) {
30 x++;
32 return x;
35 __if_exists(Type) {
36 int var23;
39 __if_exists(Type_not) {
40 this will not compile.
43 __if_not_exists(Type) {
44 this will not compile.
47 __if_not_exists(Type_not) {
48 int var244;
51 void test_if_exists_init_list() {
53 int array1[] = {
55 __if_exists(Type) {2, }
59 int array2[] = {
61 __if_exists(Type_not) { this will not compile }
65 int array3[] = {
67 __if_not_exists(Type_not) {2, }
71 int array4[] = {
73 __if_not_exists(Type) { this will not compile }
80 void test_nested_if_exists() {
81 __if_exists(Type) {
82 int x = 42;
83 __if_not_exists(Type_not) {
84 x++;