================ @@ -4734,6 +4734,65 @@ void x() { EXPECT_TRUE(matchesWithOpenMP(Source8, Matcher)); } +TEST_P(ASTMatchersTest, OMPTargetUpdateDirective_IsStandaloneDirective) { + auto Matcher = ompTargetUpdateDirective(isStandaloneDirective()); + + StringRef Source0 = R"( + void foo() { + int arr[8]; + #pragma omp target update from(arr[0:8:2]) + ; + } + )"; + EXPECT_TRUE(matchesWithOpenMP(Source0, Matcher)); +} + +TEST_P(ASTMatchersTest, OMPTargetUpdateDirective_HasStructuredBlock) { + StringRef Source0 = R"( + void foo() { + int arr[8]; + #pragma omp target update from(arr[0:8:2]) + ; + } + )"; + EXPECT_TRUE(notMatchesWithOpenMP( + Source0, ompTargetUpdateDirective(hasStructuredBlock(nullStmt())))); +} + +TEST_P(ASTMatchersTest, OMPTargetUpdateDirective_HasClause) { + auto Matcher = ompTargetUpdateDirective(hasAnyClause(anything())); + + StringRef Source0 = R"( + void foo() { + int arr[8]; + #pragma omp target update from(arr[0:8:2]) ---------------- shiltian wrote:
same here https://github.com/llvm/llvm-project/pull/150580 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits