diff options
author | Balaji V. Iyer <balaji.v.iyer@intel.com> | 2013-02-05 22:34:45 +0000 |
---|---|---|
committer | Balaji V. Iyer <balaji.v.iyer@intel.com> | 2013-02-05 22:34:45 +0000 |
commit | b4aecd7d9dc329570954d95a38810b3009f22c04 (patch) | |
tree | 0302dfb9abc64fcabbc2840fc0e1468c28fa8cc7 | |
parent | e55998983cf7b2d45fb71a760f42136371c721d9 (diff) |
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
4 files changed, 55 insertions, 0 deletions
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; +} + |