llvm-project/clang/test/AST/ast-print-openacc-init-construct.cpp
erichkeane d47401e376 [OpenACC] Start enforcing 'device_type' clause values
Researching in prep of doing the implementation for lowering, I found
that the source of the valid identifiers list from flang is in the
frontend.  This patch adds the same list to the frontend, but does it as
a sema diagnostic, so we still parse it as an identifier/identifier-like
thing, but then diagnose it as invalid later.
2025-04-09 14:55:50 -07:00

15 lines
519 B
C++

// RUN: %clang_cc1 -fopenacc -ast-print %s -o - | FileCheck %s
unsigned Int;
void uses() {
// CHECK: #pragma acc init device_type(*) device_num(Int) if(Int == 5)
#pragma acc init device_type(*) device_num(Int) if (Int == 5)
// CHECK: #pragma acc init device_type(*) device_num(Int)
#pragma acc init device_type(*) device_num(Int)
// CHECK: #pragma acc init device_type(*) if(Int == 5)
#pragma acc init device_type(*) if (Int == 5)
// CHECK: #pragma acc init device_type(radeon)
#pragma acc init device_type(radeon)
}