File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
test/Parse/ConditionalCompilation Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -321,6 +321,8 @@ class ValidateIfConfigCondition :
321321 diag::unsupported_platform_runtime_condition_argument);
322322 return nullptr ;
323323 }
324+
325+ // Just a warning for other unsupported arguments.
324326 StringRef DiagName;
325327 switch (*Kind) {
326328 case PlatformConditionKind::OS:
@@ -338,7 +340,6 @@ class ValidateIfConfigCondition :
338340 for (auto suggestion : suggestions)
339341 D.diagnose (Loc, diag::note_typo_candidate, suggestion)
340342 .fixItReplace (Arg->getSourceRange (), suggestion);
341- return nullptr ;
342343 }
343344
344345 return E;
Original file line number Diff line number Diff line change @@ -114,3 +114,27 @@ undefinedFunc() // ignored.
114114#else
115115undefinedFunc ( ) // expected-error {{use of unresolved identifier 'undefinedFunc'}}
116116#endif
117+
118+ /// Invalid platform condition arguments don't invalidate the whole condition.
119+ #if !arch(tecture) && !os(ystem) && !_endian(ness)
120+ // expected-warning@-1 {{unknown architecture for build configuration 'arch'}}
121+ // expected-note@-2 {{did you mean 'arm'?}} {{11-18=arm}}
122+ // expected-warning@-3 {{unknown operating system for build configuration 'os'}}
123+ // expected-note@-4 {{did you mean 'OSX'?}} {{27-32=OSX}}
124+ // expected-note@-5 {{did you mean 'PS4'?}} {{27-32=PS4}}
125+ // expected-warning@-6 {{unknown endianness for build configuration '_endian'}}
126+ // expected-note@-7 {{did you mean 'big'?}} {{46-50=big}}
127+ func fn_k( ) { }
128+ #endif
129+ fn_k ( )
130+
131+ #if os(cillator) || arch(ive)
132+ // expected-warning@-1 {{unknown operating system for build configuration 'os'}}
133+ // expected-note@-2 {{did you mean 'macOS'?}} {{8-16=macOS}}
134+ // expected-note@-3 {{did you mean 'iOS'?}} {{8-16=iOS}}
135+ // expected-warning@-4 {{unknown architecture for build configuration 'arch'}}
136+ // expected-note@-5 {{did you mean 'arm'?}} {{26-29=arm}}
137+ // expected-note@-6 {{did you mean 'i386'?}} {{26-29=i386}}
138+ func undefinedFunc( ) // ignored.
139+ #endif
140+ undefinedFunc( ) // expected-error {{use of unresolved identifier 'undefinedFunc'}}
You can’t perform that action at this time.
0 commit comments