int main(int argc, char **argv) {
  int a[2], b[2];
  int i;
  for (i = 0; i < 2; i++) {
    a[i] = 3;
    b[i] = 0;
  }
#pragma acc parallel copyin(a [0:N]) copyout(b [0:N])
  {
    int ii;
    for (ii = 0; ii < 2; ii++) {
      const int idx = ii;
      int n = 1;
      const int len = n;
#pragma acc cache(a [0:N])
#pragma acc cache(a [0:N], a [0:N])
#pragma acc cache(a [0:N], b [0:N])
#pragma acc cache(a[0])
#pragma acc cache(a[0], a[1], b [0:N])
#pragma acc cache(a[i - 5])
#pragma acc cache(a [i + 5:len])
#pragma acc cache(a [i + 5:len - 1])
#pragma acc cache(b[i])
#pragma acc cache(b [i:len])
#pragma acc cache(a[ii])
#pragma acc cache(a [ii:len])
#pragma acc cache(b[ii - 1])
#pragma acc cache(b [ii - 1:len])
#pragma acc cache(b[i - ii + 1])
#pragma acc cache(b [i + ii - 1:len])
#pragma acc cache(b [i * ii - 1:len + 1])
#pragma acc cache(a[idx + 2])
#pragma acc cache(a [idx:len + 2])
#pragma acc cache(a[idx])
#pragma acc cache(a [idx:len])
#pragma acc cache(a [idx + 2:len])
#pragma acc cache(a [idx + 2 + i:len])
#pragma acc cache(a [idx + 2 + i + ii:len])
      b[ii] = a[ii];
    }
  }
  for (i = 0; i < 2; i++) {
    if (a[i] != b[i])
      __builtin_abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    115d <main+0x4d>
movslq -0x24(%rbp),%rax
movl   $0x3,-0x18(%rbp,%rax,4)
movslq -0x24(%rbp),%rax
movl   $0x0,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112d <main+0x1d>
movl   $0x0,-0x28(%rbp)
cmpl   $0x2,-0x28(%rbp)
jge    119f <main+0x8f>
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
movslq -0x28(%rbp),%rax
mov    -0x18(%rbp,%rax,4),%ecx
movslq -0x28(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1164 <main+0x54>
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    11de <main+0xce>
movslq -0x24(%rbp),%rax
mov    -0x18(%rbp,%rax,4),%eax
movslq -0x24(%rbp),%rcx
cmp    -0x20(%rbp,%rcx,4),%eax
je     11cb <main+0xbb>
call   1030 <abort@plt>
jmp    11d0 <main+0xc0>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a6 <main+0x96>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca [2 x i32]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
br label %13
13: ; preds = %23, %2
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 2
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 %18
store i32 3, i32* %19
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 %21
store i32 0, i32* %22
br label %23
23: ; preds = %16
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %13
26: ; preds = %13
store i32 0, i32* %9
br label %27
27: ; preds = %40, %26
%28 = load i32, i32* %9
%29 = icmp slt i32 %28, 2
br i1 %29, label %30, label %43
30: ; preds = %27
%31 = load i32, i32* %9
store i32 %31, i32* %10
store i32 1, i32* %11
%32 = load i32, i32* %11
store i32 %32, i32* %12
%33 = load i32, i32* %9
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = load i32, i32* %9
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 %38
store i32 %36, i32* %39
br label %40
40: ; preds = %30
%41 = load i32, i32* %9
%42 = add nsw i32 %41, 1
store i32 %42, i32* %9
br label %27
43: ; preds = %27
store i32 0, i32* %8
br label %44
44: ; preds = %59, %43
%45 = load i32, i32* %8
%46 = icmp slt i32 %45, 2
br i1 %46, label %47, label %62
47: ; preds = %44
%48 = load i32, i32* %8
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 %49
%51 = load i32, i32* %50
%52 = load i32, i32* %8
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = icmp ne i32 %51, %55
br i1 %56, label %57, label %58
57: ; preds = %47
unreachable
58: ; preds = %47
br label %59
59: ; preds = %58
%60 = load i32, i32* %8
%61 = add nsw i32 %60, 1
store i32 %61, i32* %8
br label %44
62: ; preds = %44
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}