Add a missing test for the __if_exists extension

MSVC does not create a new scope for the body of an __if_exists compound
statement.  Clang already gets this right today, but it was untested.

llvm-svn: 211650
This commit is contained in:
Reid Kleckner 2014-06-25 00:10:50 +00:00
parent 27e1473143
commit 6be648f047
1 changed files with 10 additions and 0 deletions

View File

@ -25,6 +25,16 @@ void test_if_exists_stmts() {
}
}
int if_exists_creates_no_scope() {
__if_exists(MayExist::Type) {
int x; // 'x' is declared in the parent scope.
}
__if_not_exists(MayExist::Type_not) {
x++;
}
return x;
}
__if_exists(MayExist::Type) {
int var23;
}