source: CIVL/examples/omp/simplifier/simd_safelen_ptr.c@ beab7f2

main test-branch
Last change on this file since beab7f2 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

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

  • Property mode set to 100644
File size: 427 bytes
Line 
1#include<assert.h>
2int main() {
3 struct T {
4 int a[32];
5 int b[16];
6 } t;
7 int * p, * q, * r;
8
9 p = t.a;
10 q = p + 16;
11 r = t.b;
12#pragma omp simd safelen(8)
13 for (int i = 0; i < 8; i++) {
14 p[i] = 0;
15 p[i + 8] = 0;
16 q[i] = 0;
17 q[i + 8] = 0;
18 r[i] = 0;
19 r[i + 8] = 0;
20 }
21
22 for (int i = 0; i < 32; i++)
23 assert(t.a[i] == 0);
24 for (int i = 0; i < 16; i++)
25 assert(t.b[i] == 0);
26}
Note: See TracBrowser for help on using the repository browser.