Skip to content

Commit ccbc3f7

Browse files
committed
Add some tests for #if compiler
1 parent e66095b commit ccbc3f7

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// RUN: %target-typecheck-verify-swift
2+
3+
#if !compiler(>=4.1)
4+
// There should be no error here.
5+
foo bar
6+
#else
7+
let _: Int = 1
8+
#endif
9+
10+
#if compiler(<4.1)
11+
// There should be no error here.
12+
foo bar
13+
#else
14+
let _: Int = 1
15+
#endif
16+
17+
#if (compiler(>=4.1))
18+
let _: Int = 1
19+
#else
20+
// There should be no error here.
21+
foo bar
22+
#endif
23+
24+
#if !compiler(<4.1)
25+
let _: Int = 1
26+
#else
27+
// There should be no error here.
28+
foo bar
29+
#endif

0 commit comments

Comments
 (0)