llvm-project/clang/test/AST/ast-print-openacc-cache-construct.cpp
erichkeane d5cec386c1 [OpenACC] Implement 'cache' construct AST/Sema
This statement level construct takes no clauses and has no associated
statement, and simply labels a number of array elements as valid for
caching. The implementation here is pretty simple, but it is a touch of
a special case for parsing, so the parsing code reflects that.
2025-03-03 13:57:23 -08:00

10 lines
302 B
C++

// RUN: %clang_cc1 -fopenacc -ast-print %s -o - | FileCheck %s
void foo() {
int Array[5];
// CHECK: #pragma acc cache(readonly: Array[1], Array[1:2])
#pragma acc cache(readonly:Array[1], Array[1:2])
// CHECK: #pragma acc cache(Array[1], Array[1:2])
#pragma acc cache(Array[1], Array[1:2])
}