Skip to content

Commit 688a884

Browse files
authored
[clang][test] Specify value of -fopenmp=libomp for tests. (llvm#177239)
`libomp` is the default value when unconfigured in cmake, but llvm can be configured to have `libgomp` be the default instead. Explicitly specify this value so the test does not fail when it assumes libomp is always the default. Fix for f369d23 (llvm#150580)
1 parent 084916a commit 688a884

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4832,7 +4832,8 @@ TEST_P(ASTMatchersTest, OMPTargetUpdateDirective_From_HasClause) {
48324832
)";
48334833
EXPECT_TRUE(matchesWithOpenMP(Source0, Matcher));
48344834

4835-
auto astUnit = tooling::buildASTFromCodeWithArgs(Source0, {"-fopenmp"});
4835+
auto astUnit =
4836+
tooling::buildASTFromCodeWithArgs(Source0, {"-fopenmp=libomp"});
48364837
ASSERT_TRUE(astUnit);
48374838

48384839
auto Results = match(ompTargetUpdateDirective().bind("directive"),
@@ -4892,7 +4893,8 @@ TEST_P(ASTMatchersTest, OMPTargetUpdateDirective_From_ArraySection_NoStride) {
48924893
}
48934894
)";
48944895

4895-
auto astUnit = tooling::buildASTFromCodeWithArgs(Source0, {"-fopenmp"});
4896+
auto astUnit =
4897+
tooling::buildASTFromCodeWithArgs(Source0, {"-fopenmp=libomp"});
48964898
ASSERT_TRUE(astUnit);
48974899

48984900
auto Results = match(ompTargetUpdateDirective().bind("directive"),
@@ -4951,7 +4953,8 @@ TEST_P(ASTMatchersTest, OMPTargetUpdateDirective_To_HasClause) {
49514953
)";
49524954
EXPECT_TRUE(matchesWithOpenMP(Source0, Matcher));
49534955

4954-
auto astUnit = tooling::buildASTFromCodeWithArgs(Source0, {"-fopenmp"});
4956+
auto astUnit =
4957+
tooling::buildASTFromCodeWithArgs(Source0, {"-fopenmp=libomp"});
49554958
ASSERT_TRUE(astUnit);
49564959

49574960
auto Results = match(ompTargetUpdateDirective().bind("directive"),
@@ -5008,7 +5011,8 @@ TEST_P(ASTMatchersTest, OMPTargetUpdateDirective_To_ArraySection_NoStride) {
50085011
}
50095012
)";
50105013

5011-
auto astUnit = tooling::buildASTFromCodeWithArgs(Source0, {"-fopenmp"});
5014+
auto astUnit =
5015+
tooling::buildASTFromCodeWithArgs(Source0, {"-fopenmp=libomp"});
50125016
ASSERT_TRUE(astUnit);
50135017

50145018
auto Results = match(ompTargetUpdateDirective().bind("directive"),

clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2829,7 +2829,8 @@ TEST(ASTMatchersTestOpenMP, OMPFromClause) {
28292829
)";
28302830
EXPECT_TRUE(matchesWithOpenMP(Source0, Matcher));
28312831

2832-
auto astUnit = tooling::buildASTFromCodeWithArgs(Source0, {"-fopenmp"});
2832+
auto astUnit =
2833+
tooling::buildASTFromCodeWithArgs(Source0, {"-fopenmp=libomp"});
28332834
ASSERT_TRUE(astUnit);
28342835

28352836
auto Results = match(ompTargetUpdateDirective().bind("directive"),
@@ -2893,7 +2894,8 @@ TEST(ASTMatchersTestOpenMP, OMPToClause) {
28932894
)";
28942895
EXPECT_TRUE(matchesWithOpenMP(Source0, Matcher));
28952896

2896-
auto astUnit = tooling::buildASTFromCodeWithArgs(Source0, {"-fopenmp"});
2897+
auto astUnit =
2898+
tooling::buildASTFromCodeWithArgs(Source0, {"-fopenmp=libomp"});
28972899
ASSERT_TRUE(astUnit);
28982900

28992901
auto Results = match(ompTargetUpdateDirective().bind("directive"),

0 commit comments

Comments
 (0)