[flang-commits] [flang] [llvm] [mlir] [Frontend][OpenMP] Add functions for checking construct type (PR #87258)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Mon Apr 22 13:14:51 PDT 2024


================
@@ -37,3 +37,29 @@ TEST(Composition, GetCompoundConstruct) {
   Directive C6 = getCompoundConstruct({OMPD_parallel_for, OMPD_simd});
   ASSERT_EQ(C6, OMPD_parallel_for_simd);
 }
+
+TEST(Composition, IsLeafConstruct) {
+  ASSERT_TRUE(isLeafConstruct(OMPD_loop));
+  ASSERT_TRUE(isLeafConstruct(OMPD_teams));
+  ASSERT_FALSE(isLeafConstruct(OMPD_for_simd));
+  ASSERT_FALSE(isLeafConstruct(OMPD_distribute_simd));
+}
+
+TEST(Composition, IsCompositeConstruct) {
+  ASSERT_TRUE(isCompositeConstruct(OMPD_distribute_simd));
+  ASSERT_FALSE(isCompositeConstruct(OMPD_for));
+  ASSERT_TRUE(isCompositeConstruct(OMPD_for_simd));
+  // directive-name-A = "parallel", directive-name-B = "for simd",
+  // only directive-name-A is loop-associated, so this is not a
----------------
kparzysz wrote:

Done.

https://github.com/llvm/llvm-project/pull/87258


More information about the flang-commits mailing list