/* !!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!! !!! Copyright (c) 2017-20, Lawrence Livermore National Security, LLC !!! and DataRaceBench project contributors. See the DataRaceBench/COPYRIGHT file for details. !!! !!! SPDX-License-Identifier: (BSD-3-Clause) !!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!! */ /* Vector addition followed by multiplication involving the same var should have a barrier in between. Here we have an implicit barrier after parallel for regions. No data race pair. */ #include #include #include #define N 100 #define C 8 int a; int b[C]; int c[C]; int temp[C]; int main(){ for(int i=0; i=0; i--){ b[i] = temp[i] * a; } } } int val = 0; for(int i=0; i