1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
// This test checks that compiler does not crash and produces correct error output
// for different print arguments for CPU.
// RUN: not %{ispc} %s -o %t.o -DPRINT_1 --nowrap --target=host 2>&1 | FileCheck %s -check-prefix=CHECK_ERROR_1
// RUN: %{ispc} %s -o %t.o -DPRINT_2 --nowrap --target=host
// RUN: not %{ispc} %s -o %t.o -DPRINT_3 --nowrap --target=host 2>&1 | FileCheck %s -check-prefix=CHECK_ERROR_3
// RUN: not %{ispc} %s -o %t.o -DPRINT_4 --nowrap --target=host 2>&1 | FileCheck %s -check-prefix=CHECK_ERROR_4
// RUN: not %{ispc} %s -o %t.o -DPRINT_5 --nowrap --target=host 2>&1 | FileCheck %s -check-prefix=CHECK_ERROR_5
// RUN: not %{ispc} %s -o %t.o -DPRINT_6 --nowrap --target=host 2>&1 | FileCheck %s -check-prefix=CHECK_ERROR_6
// CHECK_ERROR_1: Error: syntax error, unexpected ')', expecting TOKEN_STRING_LITERAL
// CHECK_ERROR_1-NOT: FATAL ERROR
// CHECK_ERROR_3: Error: Not enough arguments are provided in print call
// CHECK_ERROR_3-NOT: FATAL ERROR
// CHECK_ERROR_4: Error: Too much arguments are provided in print call
// CHECK_ERROR_4-NOT: FATAL ERROR
// CHECK_ERROR_5: Error: Not enough arguments are provided in print call
// CHECK_ERROR_5-NOT: FATAL ERROR
// CHECK_ERROR_6: Error: Too much arguments are provided in print call
// CHECK_ERROR_6-NOT: FATAL ERROR
#ifdef PRINT_1
task void test() {
print();
}
#endif
#ifdef PRINT_2
task void test() {
print("");
}
#endif
#ifdef PRINT_3
task void test() {
print("%");
}
#endif
#ifdef PRINT_4
task void test() {
print("", 5);
}
#endif
#ifdef PRINT_5
task void test() {
print("% %", 5);
}
#endif
#ifdef PRINT_6
task void test() {
print("%", 5, 5);
}
#endif
|