[llvm] [Frontend][OpenMP] Add unit tests for getLeafConstructsOrSelf, NFC (PR #90110)
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 25 12:33:12 PDT 2024
https://github.com/kparzysz created https://github.com/llvm/llvm-project/pull/90110
None
>From 27681ba5f0fc20a263e0fd4ab6292872499244b0 Mon Sep 17 00:00:00 2001
From: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
Date: Thu, 25 Apr 2024 14:31:52 -0500
Subject: [PATCH] [Frontend][OpenMP] Add unit tests for
getLeafConstructsOrSelf, NFC
---
llvm/unittests/Frontend/OpenMPCompositionTest.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/llvm/unittests/Frontend/OpenMPCompositionTest.cpp b/llvm/unittests/Frontend/OpenMPCompositionTest.cpp
index 920b445427e7e8..0aed247ff1676b 100644
--- a/llvm/unittests/Frontend/OpenMPCompositionTest.cpp
+++ b/llvm/unittests/Frontend/OpenMPCompositionTest.cpp
@@ -23,6 +23,15 @@ TEST(Composition, GetLeafConstructs) {
ASSERT_EQ(L3, (ArrayRef<Directive>{OMPD_parallel, OMPD_for, OMPD_simd}));
}
+TEST(Composition, GetLeafConstructsOrSelf) {
+ ArrayRef<Directive> L1 = getLeafConstructsOrSelf(OMPD_loop);
+ ASSERT_EQ(L1, (ArrayRef<Directive>{OMPD_loop}));
+ ArrayRef<Directive> L2 = getLeafConstructsOrSelf(OMPD_parallel_for);
+ ASSERT_EQ(L2, (ArrayRef<Directive>{OMPD_parallel, OMPD_for}));
+ ArrayRef<Directive> L3 = getLeafConstructsOrSelf(OMPD_parallel_for_simd);
+ ASSERT_EQ(L3, (ArrayRef<Directive>{OMPD_parallel, OMPD_for, OMPD_simd}));
+}
+
TEST(Composition, GetCompoundConstruct) {
Directive C1 =
getCompoundConstruct({OMPD_target, OMPD_teams, OMPD_distribute});
More information about the llvm-commits
mailing list