From: Gheorghe-Teodor Bercea Date: Wed, 9 Aug 2017 18:25:52 +0000 (+0000) Subject: [OpenMP] Make the PTX version tests general enough to work on all toolchains. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c06b6e025b2cc470a6212c1ebf4c51f4b80feb19;p=clang [OpenMP] Make the PTX version tests general enough to work on all toolchains. Add explicit test for Darwin and PowerPC. Clean-up tests. Non-functional change. Original diff: D29660 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310505 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Driver/openmp-offload.c b/test/Driver/openmp-offload.c index 30dd1ea2ab..45889b1329 100644 --- a/test/Driver/openmp-offload.c +++ b/test/Driver/openmp-offload.c @@ -691,7 +691,7 @@ /// ########################################################################### /// Check PTXAS is passed -c flag when offloading to an NVIDIA device using OpenMP. -// RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -no-canonical-prefixes %s 2>&1 \ +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PTXAS-DEFAULT %s // CHK-PTXAS-DEFAULT: ptxas{{.*}}" "-c" @@ -699,7 +699,7 @@ /// ########################################################################### /// PTXAS is passed -c flag by default when offloading to an NVIDIA device using OpenMP - disable it. -// RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -fnoopenmp-relocatable-target -no-canonical-prefixes %s 2>&1 \ +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -fnoopenmp-relocatable-target %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PTXAS-NORELO %s // CHK-PTXAS-NORELO-NOT: ptxas{{.*}}" "-c" @@ -708,7 +708,7 @@ /// PTXAS is passed -c flag by default when offloading to an NVIDIA device using OpenMP /// Check that the flag is passed when -fopenmp-relocatable-target is used. -// RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -fopenmp-relocatable-target -no-canonical-prefixes %s 2>&1 \ +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -fopenmp-relocatable-target %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PTXAS-RELO %s // CHK-PTXAS-RELO: ptxas{{.*}}" "-c" @@ -716,9 +716,25 @@ /// ########################################################################### /// Check PTXAS is passed the compute capability passed to the driver. -// RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda --fopenmp-ptx=+ptx52 -save-temps -no-canonical-prefixes %s 2>&1 \ +// RUN: %clang -### -no-canonical-prefixes -target powerpc64le-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda --fopenmp-ptx=+ptx52 -save-temps %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHK-PTXAS-PPC64-VERSION %s + +// CHK-PTXAS-PPC64-VERSION: clang{{.*}}.bc" {{.*}}"-target-feature" "+ptx52" +// CHK-PTXAS-PPC64-VERSION-NEXT: clang{{.*}}.bc" {{.*}}"-target-feature" "+ptx52" +// CHK-PTXAS-PPC64-VERSION-NEXT: clang{{.*}}.bc" {{.*}}"-target-feature" "+ptx52" + +/// ########################################################################### + +/// Check PTXAS is passed the compute capability passed to the driver. +// RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda --fopenmp-ptx=+ptx52 %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PTXAS-VERSION %s // CHK-PTXAS-VERSION: clang{{.*}}.bc" {{.*}}"-target-feature" "+ptx52" -// CHK-PTXAS-VERSION-NEXT: clang{{.*}}.bc" {{.*}}"-target-feature" "+ptx52" -// CHK-PTXAS-VERSION-NEXT: clang{{.*}}.bc" {{.*}}"-target-feature" "+ptx52" + +/// ########################################################################### + +/// Check PTXAS is passed the compute capability passed to the driver. +// RUN: %clang -### -no-canonical-prefixes -target x86_64-apple-darwin17.0.0 -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda --fopenmp-ptx=+ptx52 %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHK-PTXAS-DARWIN-VERSION %s + +// CHK-PTXAS-DARWIN-VERSION: clang{{.*}}.bc" {{.*}}"-target-feature" "+ptx52"