|
| 1 | +// RUN: echo "-DTEST0" > %t.0.resp |
| 2 | +// RUN: %target-build-swift -typecheck @%t.0.resp %s 2>&1 | %FileCheck %s -check-prefix=SHORT |
| 3 | +// SHORT: warning: result of call to 'abs' is unused |
| 4 | + |
| 5 | +// RUN: python -c 'for a in ["A", "B", "C", "D"]: print "-DTEST1" + a' > %t.1.resp |
| 6 | +// RUN: %target-build-swift -typecheck @%t.1.resp %s 2>&1 | %FileCheck %s -check-prefix=MULTIPLE |
| 7 | +// MULTIPLE: warning: result of call to 'abs' is unused |
| 8 | + |
| 9 | +// RUN: echo "-DTEST2A -DTEST2B" > %t.2.resp |
| 10 | +// RUN: echo "-DTEST2C -DTEST2D" > %t.3.resp |
| 11 | +// RUN: %target-build-swift -typecheck @%t.2.resp %s @%t.3.resp 2>&1 | %FileCheck %s -check-prefix=MIXED |
| 12 | +// MIXED: warning: result of call to 'abs' is unused |
| 13 | + |
| 14 | +// RUN: echo "-DTEST3A" > %t.4.resp |
| 15 | +// RUN: echo "%s" >> %t.4.resp |
| 16 | +// RUN: echo "-DTEST3B" >> %t.4.resp |
| 17 | +// RUN: %target-build-swift -typecheck @%t.4.resp 2>&1 | %FileCheck %s -check-prefix=RESPONLY |
| 18 | +// RESPONLY: warning: result of call to 'abs' is unused |
| 19 | + |
| 20 | +// RUN: echo "-DTEST4A" > %t.5.resp |
| 21 | +// RUN: echo "%s" >> %t.5.resp |
| 22 | +// RUN: echo "@%t.5.resp" > %t.6.resp |
| 23 | +// RUN: echo "-DTEST4B" >> %t.6.resp |
| 24 | +// RUN: %target-build-swift -typecheck @%t.6.resp 2>&1 | %FileCheck %s -check-prefix=RECURSIVE |
| 25 | +// RECURSIVE: warning: result of call to 'abs' is unused |
| 26 | + |
| 27 | +#if TEST0 |
| 28 | +abs(-5) |
| 29 | +#endif |
| 30 | + |
| 31 | +#if TEST1A && TEST1B && TEST1C && TEST1D |
| 32 | +abs(-5) |
| 33 | +#endif |
| 34 | + |
| 35 | +#if TEST2A && TEST2B && TEST2C && TEST2D |
| 36 | +abs(-5) |
| 37 | +#endif |
| 38 | + |
| 39 | +#if TEST3A && TEST3B |
| 40 | +abs(-5) |
| 41 | +#endif |
| 42 | + |
| 43 | +#if TEST4A && TEST4B |
| 44 | +abs(-5) |
| 45 | +#endif |
0 commit comments