[PATCH] D65272: Update some tests after r366702

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 25 04:46:32 PDT 2019


krasimir created this revision.
Herald added a reviewer: jdoerfert.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

r366702 added a set of new clang-cl -- specific openmp flags together with tests.
The way the newly added tests work is problematic: consider for example this
asertion:

  // RUN: %clang_cl --target=x86_64-windows-msvc /openmp -### -- %s 2>&1 | FileCheck --check-prefix=CHECK-CC1-OPENMP %s
  ...
  // CHECK-CC1-OPENMP: "-fopenmp"

It asserts that an `/openmp` flag should expand into `-fopenmp`. This however
depends on the default value of Clang's CLANG_DEFAULT_OPENMP_RUNTIME value.
Indeed, the code that adds `-fopenmp` to the output only does it if the default
runtime is `libomp` or `libiomp5`, not when it is `libgomp`.

I've updated the tests to not depend on the default value of this setting by
specifying the runtime to use explicitly in each assertion.


Repository:
  rC Clang

https://reviews.llvm.org/D65272

Files:
  test/Driver/fopenmp.c


Index: test/Driver/fopenmp.c
===================================================================
--- test/Driver/fopenmp.c
+++ test/Driver/fopenmp.c
@@ -13,9 +13,12 @@
 // RUN: %clang -target x86_64-windows-gnu -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
 // RUN: %clang -target x86_64-windows-gnu -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
 // RUN: %clang -target x86_64-windows-gnu -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
-// RUN: %clang -target x86_64-windows-gnu -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
-// RUN: %clang_cl --target=x86_64-windows-msvc /openmp -### -- %s 2>&1 | FileCheck --check-prefix=CHECK-CC1-OPENMP %s
-// RUN: %clang_cl --target=i686-windows-msvc /openmp:experimental -### -- %s 2>&1 | FileCheck --check-prefix=CHECK-CC1-OPENMP %s
+// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libomp /openmp -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libgomp /openmp -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
+// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libiomp5 /openmp -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libomp /openmp:experimental -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libgomp /openmp:experimental -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
+// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libiomp5 /openmp:experimental -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
 // RUN: %clang_cl --target=x86_64-windows-msvc /openmp- -### -- %s 2>&1 | FileCheck --check-prefix=CHECK-CC1-NO-OPENMP %s
 //
 // CHECK-CC1-OPENMP: "-cc1"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65272.211713.patch
Type: text/x-patch
Size: 1972 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190725/8cd68dbd/attachment.bin>


More information about the cfe-commits mailing list