[clang] [Clang][Unittest] Support for `target` update directive and `from` clause in clang unittests (PR #150580)
Shilei Tian via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 12 08:27:27 PST 2026
================
@@ -2770,6 +2770,140 @@ void x() {
EXPECT_TRUE(notMatchesWithOpenMP(Source2, Matcher));
}
+TEST(ASTMatchersTestOpenMP, OMPTargetUpdateDirective_From) {
+ auto Matcher = stmt(ompTargetUpdateDirective());
+
+ StringRef Source0 = R"(
+ void foo() {
+ int arr[8];
+ #pragma omp target update from(arr[0:8:2])
+ ;
+ }
+ )";
+ EXPECT_TRUE(matchesWithOpenMP(Source0, Matcher));
----------------
shiltian wrote:
Not exactly align with what I had in mind but it can be improved later.
https://github.com/llvm/llvm-project/pull/150580
More information about the cfe-commits
mailing list