From b4aecd7d9dc329570954d95a38810b3009f22c04 Mon Sep 17 00:00:00 2001 From: "Balaji V. Iyer" Date: Tue, 5 Feb 2013 22:34:45 +0000 Subject: Added the testsuite files that were accidentally omitted. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/cilkplus@195767 138bc75d-0d04-0410-961f-82ee72b054a4 --- .../cilk_keywords_test/errors/grainsize_error2.c | 13 ++++++++++++ .../cilk_keywords_test/errors/grainsize_error3.c | 11 +++++++++++ .../cilk_keywords_test/errors/no_args_error.c | 8 ++++++++ .../cilk_keywords_test/errors/wraparound.c | 23 ++++++++++++++++++++++ 4 files changed, 55 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error2.c create mode 100644 gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error3.c create mode 100644 gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/no_args_error.c create mode 100644 gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/wraparound.c diff --git a/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error2.c b/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error2.c new file mode 100644 index 00000000000..aa4707c95ec --- /dev/null +++ b/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error2.c @@ -0,0 +1,13 @@ +/* { dg-options "-Wno-div-by-zero" } */ + +int a[256]; + +void check() { + int i; +#pragma cilk grainsize=5/0 /* { dg-error "cannot convert grain" } */ + _Cilk_for(i = 0; i < 256; i++) { + a[i] = i; + } +} + + diff --git a/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error3.c b/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error3.c new file mode 100644 index 00000000000..916609df437 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error3.c @@ -0,0 +1,11 @@ +int a[256]; + +void check() { + int i; +#pragma cilk grainsize=*NULL /* { dg-error "undeclared" } */ + _Cilk_for(i = 0; i < 256; i++) { + a[i] = i; + } +} + + diff --git a/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/no_args_error.c b/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/no_args_error.c new file mode 100644 index 00000000000..49c2041c06e --- /dev/null +++ b/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/no_args_error.c @@ -0,0 +1,8 @@ +int spawn_1 (); +typedef int(*func) (int); + +void check () { + func var = spawn_1; + _Cilk_spawn var (); /* { dg-error "too few arguments to function" } */ +} + diff --git a/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/wraparound.c b/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/wraparound.c new file mode 100644 index 00000000000..fe81e784204 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/wraparound.c @@ -0,0 +1,23 @@ +void check(int stride, int *a) { + int i; + _Cilk_for (i = 255; i > 0; i += stride) /* This is OK! */ + a[i] |= 4; + _Cilk_for (i = 255; i > 0; i += -1) /* This is OK! */ + a[i] |= 4; + _Cilk_for (i = 255; i > 0; i -= 1) /* This is OK! */ + a[i] |= 4; + _Cilk_for (i = 255; i > 0; i-- ) /* This is OK! */ + a[i] |= 4; + _Cilk_for (i = 255; i > 0; --i ) /* This is OK! */ + a[i] |= 4; + + _Cilk_for (i = 255; i > 0; ++i ) /* { dg-error "greater than" } */ + a[i] |= 4; + _Cilk_for (i = 255; i > 0; i++ ) /* { dg-error "greater than" } */ + a[i] |= 4; + _Cilk_for (i = 255; i > 0; i +=2) /* { dg-error "greater than" } */ + a[i] |= 4; + _Cilk_for (i = 255; i > 0; i -=-2) /* { dg-error "greater than" } */ + a[i] |= 4; +} + -- cgit v1.2.3