aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Frontend
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <Krzysztof.Parzyszek@amd.com>2024-12-02 08:11:49 -0600
committerGitHub <noreply@github.com>2024-12-02 08:11:49 -0600
commitcdbd22876b71acad9e5eeceadc0d8859e6e73b18 (patch)
treeffb5270d772dbbdbfe1313ada51d6040b470ec4a /llvm/unittests/Frontend
parent94488445cdd1657d1363a4994393b193c291b2cc (diff)
downloadllvm-cdbd22876b71acad9e5eeceadc0d8859e6e73b18.zip
llvm-cdbd22876b71acad9e5eeceadc0d8859e6e73b18.tar.gz
llvm-cdbd22876b71acad9e5eeceadc0d8859e6e73b18.tar.bz2
[flang][OpenMP] Use new modifiers in ALLOCATE clause (#117627)
Again, this simplifies the semantic checks and lowering quite a bit. Update the check for positive alignment to use a more informative message, and to highlight the modifier itsef, not the whole clause. Remove the checks for the allocator expression itself being positive: there is nothing in the spec that says that it should be positive. Remove the "simple" modifier from the AllocateT template, since both simple and complex modifiers are the same thing, only differing in syntax.
Diffstat (limited to 'llvm/unittests/Frontend')
-rw-r--r--llvm/unittests/Frontend/OpenMPDecompositionTest.cpp50
1 files changed, 22 insertions, 28 deletions
diff --git a/llvm/unittests/Frontend/OpenMPDecompositionTest.cpp b/llvm/unittests/Frontend/OpenMPDecompositionTest.cpp
index f954113..8f195c4 100644
--- a/llvm/unittests/Frontend/OpenMPDecompositionTest.cpp
+++ b/llvm/unittests/Frontend/OpenMPDecompositionTest.cpp
@@ -686,12 +686,12 @@ TEST_F(OpenMPDecompositionTest, Order1) {
std::string Dir3 = stringify(Dec.output[3]);
std::string Dir4 = stringify(Dec.output[4]);
std::string Dir5 = stringify(Dec.output[5]);
- ASSERT_EQ(Dir0, "target"); // (31)
- ASSERT_EQ(Dir1, "teams"); // (31)
+ ASSERT_EQ(Dir0, "target"); // (31)
+ ASSERT_EQ(Dir1, "teams"); // (31)
ASSERT_EQ(Dir2, "distribute order(1, 0)"); // (31)
- ASSERT_EQ(Dir3, "parallel"); // (31)
- ASSERT_EQ(Dir4, "for order(1, 0)"); // (31)
- ASSERT_EQ(Dir5, "simd order(1, 0)"); // (31)
+ ASSERT_EQ(Dir3, "parallel"); // (31)
+ ASSERT_EQ(Dir4, "for order(1, 0)"); // (31)
+ ASSERT_EQ(Dir5, "simd order(1, 0)"); // (31)
}
// ALLOCATE
@@ -708,8 +708,7 @@ TEST_F(OpenMPDecompositionTest, Allocate1) {
// Allocate + firstprivate
omp::List<omp::Clause> Clauses{
- {OMPC_allocate,
- omp::clause::Allocate{{std::nullopt, std::nullopt, std::nullopt, {x}}}},
+ {OMPC_allocate, omp::clause::Allocate{{std::nullopt, std::nullopt, {x}}}},
{OMPC_firstprivate, omp::clause::Firstprivate{{x}}},
};
@@ -719,8 +718,8 @@ TEST_F(OpenMPDecompositionTest, Allocate1) {
std::string Dir0 = stringify(Dec.output[0]);
std::string Dir1 = stringify(Dec.output[1]);
- ASSERT_EQ(Dir0, "parallel shared(x)"); // (33)
- ASSERT_EQ(Dir1, "sections firstprivate(x) allocate(, , , (x))"); // (33)
+ ASSERT_EQ(Dir0, "parallel shared(x)"); // (33)
+ ASSERT_EQ(Dir1, "sections firstprivate(x) allocate(, , (x))"); // (33)
}
TEST_F(OpenMPDecompositionTest, Allocate2) {
@@ -729,8 +728,7 @@ TEST_F(OpenMPDecompositionTest, Allocate2) {
// Allocate + in_reduction
omp::List<omp::Clause> Clauses{
- {OMPC_allocate,
- omp::clause::Allocate{{std::nullopt, std::nullopt, std::nullopt, {x}}}},
+ {OMPC_allocate, omp::clause::Allocate{{std::nullopt, std::nullopt, {x}}}},
{OMPC_in_reduction, omp::clause::InReduction{{{Add}, {x}}}},
};
@@ -740,8 +738,8 @@ TEST_F(OpenMPDecompositionTest, Allocate2) {
std::string Dir0 = stringify(Dec.output[0]);
std::string Dir1 = stringify(Dec.output[1]);
- ASSERT_EQ(Dir0, "target in_reduction((3), (x)) allocate(, , , (x))"); // (33)
- ASSERT_EQ(Dir1, "parallel"); // (33)
+ ASSERT_EQ(Dir0, "target in_reduction((3), (x)) allocate(, , (x))"); // (33)
+ ASSERT_EQ(Dir1, "parallel"); // (33)
}
TEST_F(OpenMPDecompositionTest, Allocate3) {
@@ -749,8 +747,7 @@ TEST_F(OpenMPDecompositionTest, Allocate3) {
// Allocate + linear
omp::List<omp::Clause> Clauses{
- {OMPC_allocate,
- omp::clause::Allocate{{std::nullopt, std::nullopt, std::nullopt, {x}}}},
+ {OMPC_allocate, omp::clause::Allocate{{std::nullopt, std::nullopt, {x}}}},
{OMPC_linear,
omp::clause::Linear{{std::nullopt, std::nullopt, std::nullopt, {x}}}},
};
@@ -765,7 +762,7 @@ TEST_F(OpenMPDecompositionTest, Allocate3) {
// should be fixed eventually.
ASSERT_EQ(Dir0, "parallel shared(x) shared(x)"); // (33)
ASSERT_EQ(Dir1, "for linear(, , , (x)) firstprivate(x) lastprivate(, (x)) "
- "allocate(, , , (x))"); // (33)
+ "allocate(, , (x))"); // (33)
}
TEST_F(OpenMPDecompositionTest, Allocate4) {
@@ -773,8 +770,7 @@ TEST_F(OpenMPDecompositionTest, Allocate4) {
// Allocate + lastprivate
omp::List<omp::Clause> Clauses{
- {OMPC_allocate,
- omp::clause::Allocate{{std::nullopt, std::nullopt, std::nullopt, {x}}}},
+ {OMPC_allocate, omp::clause::Allocate{{std::nullopt, std::nullopt, {x}}}},
{OMPC_lastprivate, omp::clause::Lastprivate{{std::nullopt, {x}}}},
};
@@ -784,8 +780,8 @@ TEST_F(OpenMPDecompositionTest, Allocate4) {
std::string Dir0 = stringify(Dec.output[0]);
std::string Dir1 = stringify(Dec.output[1]);
- ASSERT_EQ(Dir0, "parallel shared(x)"); // (33)
- ASSERT_EQ(Dir1, "sections lastprivate(, (x)) allocate(, , , (x))"); // (33)
+ ASSERT_EQ(Dir0, "parallel shared(x)"); // (33)
+ ASSERT_EQ(Dir1, "sections lastprivate(, (x)) allocate(, , (x))"); // (33)
}
TEST_F(OpenMPDecompositionTest, Allocate5) {
@@ -793,8 +789,7 @@ TEST_F(OpenMPDecompositionTest, Allocate5) {
// Allocate + private
omp::List<omp::Clause> Clauses{
- {OMPC_allocate,
- omp::clause::Allocate{{std::nullopt, std::nullopt, std::nullopt, {x}}}},
+ {OMPC_allocate, omp::clause::Allocate{{std::nullopt, std::nullopt, {x}}}},
{OMPC_private, omp::clause::Private{{x}}},
};
@@ -804,8 +799,8 @@ TEST_F(OpenMPDecompositionTest, Allocate5) {
std::string Dir0 = stringify(Dec.output[0]);
std::string Dir1 = stringify(Dec.output[1]);
- ASSERT_EQ(Dir0, "parallel"); // (33)
- ASSERT_EQ(Dir1, "sections private(x) allocate(, , , (x))"); // (33)
+ ASSERT_EQ(Dir0, "parallel"); // (33)
+ ASSERT_EQ(Dir1, "sections private(x) allocate(, , (x))"); // (33)
}
TEST_F(OpenMPDecompositionTest, Allocate6) {
@@ -814,8 +809,7 @@ TEST_F(OpenMPDecompositionTest, Allocate6) {
// Allocate + reduction
omp::List<omp::Clause> Clauses{
- {OMPC_allocate,
- omp::clause::Allocate{{std::nullopt, std::nullopt, std::nullopt, {x}}}},
+ {OMPC_allocate, omp::clause::Allocate{{std::nullopt, std::nullopt, {x}}}},
{OMPC_reduction, omp::clause::Reduction{{std::nullopt, {Add}, {x}}}},
};
@@ -825,8 +819,8 @@ TEST_F(OpenMPDecompositionTest, Allocate6) {
std::string Dir0 = stringify(Dec.output[0]);
std::string Dir1 = stringify(Dec.output[1]);
- ASSERT_EQ(Dir0, "parallel shared(x)"); // (33)
- ASSERT_EQ(Dir1, "sections reduction(, (3), (x)) allocate(, , , (x))"); // (33)
+ ASSERT_EQ(Dir0, "parallel shared(x)"); // (33)
+ ASSERT_EQ(Dir1, "sections reduction(, (3), (x)) allocate(, , (x))"); // (33)
}
// REDUCTION