source: CIVL/examples/omp/DataRaceBench/micro-benchmarks/truedeplinear-orig-yes.c@ 3c8cc6c

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since 3c8cc6c was 36a61f3, checked in by Ziqing Luo <ziqing@…>, 9 years ago

Commit DataRaceBench into CIVL examples

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@4225 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 302 bytes
Line 
1// Linear equation as array subscription
2#include <stdlib.h>
3#include <stdio.h>
4int main(int argc, char* argv[])
5{
6 int i;
7
8 int a[2000];
9
10 for (i=0; i<2000; i++)
11 a[i]=i;
12
13#pragma omp parallel for
14 for (i=0;i<1000;i++)
15 a[2*i+1]=a[i]+1;
16
17 printf("a[1001]=%d\n", a[1001]);
18 return 0;
19}
20
Note: See TracBrowser for help on using the repository browser.