Skip to content

[OpenMP] Allow dynamic condition selector in Metadirective #86457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions clang/test/OpenMP/metadirective_ast_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ void foo(void) {
: parallel) default(nothing)
for (int i = 0; i < 16; i++)
;

int non_const_val = 1;
#pragma omp metadirective when(user = {condition(non_const_val > 0)} \
: parallel) default(nothing)
bar();
}

// CHECK: void bar(void);
Expand Down Expand Up @@ -107,5 +112,8 @@ void foo(void) {
// CHECK-AMDGCN-NEXT: for (int i = 0; i < 100; i++)
// CHECK: for (int i = 0; i < 16; i++)
// CHECK: for (int i = 0; i < 16; i++)
// CHECK: int non_const_val = 1;
// CHECK-NEXT: #pragma omp parallel
Copy link
Contributor Author

@robincaloudis robincaloudis Mar 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actual behavior: #pragma omp parallel is not in the AST as the default for non-const user condition is used

Expected: #pragma omp parallel should be in the AST as dynamic user conditions that are resolved during runtime are fully specified by OpenMP 5.1

// CHECK-NEXT: bar()

#endif