Ver código fonte

[AST] OMPStructuredBlockTest: avoid using multiline string literals in macros

That is what i have been doing elsewhere in these tests, maybe that's it?

Maybe this helps with failing builds:
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/17921
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-global-isel/builds/10248

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356749 91177308-0d34-0410-b5e6-96231b3b80d8
Roman Lebedev 6 anos atrás
pai
commit
990ffcb804
1 arquivos alterados com 9 adições e 7 exclusões
  1. 9 7
      unittests/AST/OMPStructuredBlockTest.cpp

+ 9 - 7
unittests/AST/OMPStructuredBlockTest.cpp

@@ -102,11 +102,12 @@ void test() {
     #pragma omp cancel parallel
     #pragma omp cancel parallel
 }
 }
 })";
 })";
-  ASSERT_TRUE(
-      PrintedOMPStmtMatches(Source, OMPInnermostStructuredBlockMatcher(), R"({
+  const char *Expected = R"({
     #pragma omp cancel parallel
     #pragma omp cancel parallel
 }
 }
-)"));
+)";
+  ASSERT_TRUE(PrintedOMPStmtMatches(
+      Source, OMPInnermostStructuredBlockMatcher(), Expected));
   ASSERT_TRUE(PrintedOMPStmtMatches(Source, OMPStandaloneDirectiveMatcher(),
   ASSERT_TRUE(PrintedOMPStmtMatches(Source, OMPStandaloneDirectiveMatcher(),
                                     "#pragma omp cancel parallel\n"));
                                     "#pragma omp cancel parallel\n"));
 }
 }
@@ -117,14 +118,15 @@ TEST(OMPStructuredBlock, TestCancellationPoint) {
 void test() {
 void test() {
 #pragma omp parallel
 #pragma omp parallel
 {
 {
-#pragma omp cancellation point parallel
+    #pragma omp cancellation point parallel
 }
 }
 })";
 })";
-  ASSERT_TRUE(
-      PrintedOMPStmtMatches(Source, OMPInnermostStructuredBlockMatcher(), R"({
+  const char *Expected = R"({
     #pragma omp cancellation point parallel
     #pragma omp cancellation point parallel
 }
 }
-)"));
+)";
+  ASSERT_TRUE(PrintedOMPStmtMatches(
+      Source, OMPInnermostStructuredBlockMatcher(), Expected));
   ASSERT_TRUE(
   ASSERT_TRUE(
       PrintedOMPStmtMatches(Source, OMPStandaloneDirectiveMatcher(),
       PrintedOMPStmtMatches(Source, OMPStandaloneDirectiveMatcher(),
                             "#pragma omp cancellation point parallel\n"));
                             "#pragma omp cancellation point parallel\n"));