Skip to content

Commit 4631e7b

Browse files
authored
[Frontend][OpenMP] Add unit tests for getLeafConstructsOrSelf, NFC (#90110)
1 parent 33ccd03 commit 4631e7b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

llvm/unittests/Frontend/OpenMPCompositionTest.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ TEST(Composition, GetLeafConstructs) {
2323
ASSERT_EQ(L3, (ArrayRef<Directive>{OMPD_parallel, OMPD_for, OMPD_simd}));
2424
}
2525

26+
TEST(Composition, GetLeafConstructsOrSelf) {
27+
ArrayRef<Directive> L1 = getLeafConstructsOrSelf(OMPD_loop);
28+
ASSERT_EQ(L1, (ArrayRef<Directive>{OMPD_loop}));
29+
ArrayRef<Directive> L2 = getLeafConstructsOrSelf(OMPD_parallel_for);
30+
ASSERT_EQ(L2, (ArrayRef<Directive>{OMPD_parallel, OMPD_for}));
31+
ArrayRef<Directive> L3 = getLeafConstructsOrSelf(OMPD_parallel_for_simd);
32+
ASSERT_EQ(L3, (ArrayRef<Directive>{OMPD_parallel, OMPD_for, OMPD_simd}));
33+
}
34+
2635
TEST(Composition, GetCompoundConstruct) {
2736
Directive C1 =
2837
getCompoundConstruct({OMPD_target, OMPD_teams, OMPD_distribute});

0 commit comments

Comments
 (0)