diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-05-02 14:43:35 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-05-02 14:43:35 +0000 |
commit | 34efdaf078b01a7387007c4e6bde6db86384c4b7 (patch) | |
tree | d503eaf41d085669d1481bb46ec038bc866fece6 /gcc/testsuite/gcc.dg/cilk-plus | |
parent | f733cf303bcdc952c92b81dd62199a40a1f555ec (diff) | |
download | gcc-tarball-master.tar.gz |
gcc-7.1.0gcc-7.1.0
Diffstat (limited to 'gcc/testsuite/gcc.dg/cilk-plus')
-rw-r--r-- | gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cilk-plus/pr78306.c | 30 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cilk-plus/pr79116.c | 9 |
3 files changed, 41 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp b/gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp index dbcd0be780..447ed04f02 100644 --- a/gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp +++ b/gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2016 Free Software Foundation, Inc. +# Copyright (C) 2013-2017 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ if [cilkplus_init] { dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -fcilkplus -O3 -std=c99" " " dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -fcilkplus -g -O0 -std=c99" " " - if { [check_libcilkrts_available] } { + if { [check_effective_target_cilkplus_runtime] } { dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -g " " " dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O1 " " " dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O2 -std=c99 " " " diff --git a/gcc/testsuite/gcc.dg/cilk-plus/pr78306.c b/gcc/testsuite/gcc.dg/cilk-plus/pr78306.c new file mode 100644 index 0000000000..4604271441 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cilk-plus/pr78306.c @@ -0,0 +1,30 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fcilkplus" } */ + +#define _FORTIFY_SOURCE 2 +#include <string.h> + +int sum(int low, int high) +{ + if(low == high) { + return low; + } + + int mid = low + (high-low)/2; + int a = _Cilk_spawn sum(low, mid); + int b = sum(mid+1, high); + + // Some very expensive computation here + int foo[64]; + memset(foo, 0, 64*sizeof(int)); // <--- Fails + + _Cilk_sync; + + return a+b; +} + +int main(void) { + if (sum(0, 100) != 5050) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/cilk-plus/pr79116.c b/gcc/testsuite/gcc.dg/cilk-plus/pr79116.c new file mode 100644 index 0000000000..9206aaf3a1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cilk-plus/pr79116.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-fcilkplus" } */ + +int array[1024]; +void foo() +{ + _Cilk_for (int i = 0; i < 512; ++i) + array[:] = __sec_implicit_index(0); +} |