[clang] 722c39f - [HIP] Tighten checks in hip-include-path.hip test case

Björn Pettersson A via cfe-commits cfe-commits at lists.llvm.org
Wed May 26 02:17:19 PDT 2021


Having some problems to reproduce this (my build fails for some unknown reason when trying to use -DLLVM_LIBDIR_SUFFIX=64).

But I made a "speculative" fix here:
  https://reviews.llvm.org/rGa3b3f7e631981bd861d5fe5e20f33b11a0dac978

Tom: Can you try again with an updated main branch?
Or maybe let me know if this makes your bots happy again (or if there is an URL where I can follow up on that myself)?

/Björn

> -----Original Message-----
> From: Björn Pettersson A
> Sent: den 26 maj 2021 09:35
> To: Tom Stellard <tstellar at redhat.com>; Bjorn Pettersson
> <llvmlistbot at llvm.org>; cfe-commits at lists.llvm.org
> Cc: Konrad Kleine <kkleine at redhat.com>
> Subject: RE: [clang] 722c39f - [HIP] Tighten checks in hip-include-path.hip
> test case
> 
> Ok. Thanks for noticing.
> 
> It was probably a bit too optimistic to match on "lib/clang" in those
> checks.
> Probably need to relax that part a bit again, while still matching on the
> [[ROOT]] to avoid that the test case depends on how users name their build
> directories.
> 
> I'll have a look, and will try to fix that.
> 
> /Björn
> 
> > -----Original Message-----
> > From: Tom Stellard <tstellar at redhat.com>
> > Sent: den 26 maj 2021 09:21
> > To: Björn Pettersson A <bjorn.a.pettersson at ericsson.com>; Bjorn
> Pettersson
> > <llvmlistbot at llvm.org>; cfe-commits at lists.llvm.org
> > Cc: Konrad Kleine <kkleine at redhat.com>
> > Subject: Re: [clang] 722c39f - [HIP] Tighten checks in hip-include-
> path.hip
> > test case
> >
> > On 5/19/21 4:15 AM, Bjorn Pettersson via cfe-commits wrote:
> > >
> > > Author: Bjorn Pettersson
> > > Date: 2021-05-19T13:11:57+02:00
> > > New Revision: 722c39fef5ab611b3196e964bb3177a5ab473355
> > >
> > > URL: https://protect2.fireeye.com/v1/url?k=3be9be67-64728685-3be9fefc-
> > 86073b36ea28-68d3cb517eaa1094&q=1&e=735586c1-eff9-470c-aae6-
> > 72947e725d9a&u=https%3A%2F%2Fgithub.com%2Fllvm%2Fllvm-
> > project%2Fcommit%2F722c39fef5ab611b3196e964bb3177a5ab473355
> > > DIFF: https://protect2.fireeye.com/v1/url?k=fc17d1e7-a38ce905-fc17917c-
> > 86073b36ea28-7c1616c235ef9d99&q=1&e=735586c1-eff9-470c-aae6-
> > 72947e725d9a&u=https%3A%2F%2Fgithub.com%2Fllvm%2Fllvm-
> > project%2Fcommit%2F722c39fef5ab611b3196e964bb3177a5ab473355.diff
> > >
> >
> > Hi,
> >
> > This patch causes the testcase to fail when the
> > -DLLVM_LIBDIR_SUFFIX=64 option is passed to cmake.
> >
> > -Tom
> >
> > > LOG: [HIP] Tighten checks in hip-include-path.hip test case
> > >
> > > The checks (both positive and negative checks) in the test case
> > > hip-include-path.hip could mistakenly end up matching the string
> > > "clang" from the InstalledDir in case the build dir for example
> > > was named "/home/username/build-clang/". Intention with this
> > > patch is to tighten up the checks a bit to filter our the
> > > part of the paths that match with InstalledDir when doing the
> > > checks, as well as matching "/lib/clang/" rather than
> > > just "clang/".
> > >
> > > Problem was found when building with
> > >    -DCLANG_DEFAULT_RTLIB=compiler-rt
> > >    -DCLANG_DEFAULT_CXX_STDLIB=libc++
> > > and having "clang/" in the path to the build dir.
> > >
> > > Reviewed By: yaxunl
> > >
> > > Differential Revision: https://protect2.fireeye.com/v1/url?k=e3ac08f2-
> > bc373010-e3ac4869-86073b36ea28-0d6892c00c3865fd&q=1&e=735586c1-eff9-470c-
> > aae6-72947e725d9a&u=https%3A%2F%2Freviews.llvm.org%2FD102723
> > >
> > > Added:
> > >
> > >
> > > Modified:
> > >      clang/test/Driver/hip-include-path.hip
> > >
> > > Removed:
> > >
> > >
> > >
> > >
> >
> ###########################################################################
> > #####
> > > diff  --git a/clang/test/Driver/hip-include-path.hip
> > b/clang/test/Driver/hip-include-path.hip
> > > index 7af06fabe5ae..4e15e28fb276 100644
> > > --- a/clang/test/Driver/hip-include-path.hip
> > > +++ b/clang/test/Driver/hip-include-path.hip
> > > @@ -16,36 +16,40 @@
> > >   // RUN:   -std=c++11 --rocm-path=%S/Inputs/rocm -nogpuinc -nogpulib
> %s
> > 2>&1 \
> > >   // RUN:   | FileCheck -check-prefixes=COMMON,CLANG,NOHIP %s
> > >
> > > +// COMMON: InstalledDir: [[ROOT:[^"]*]]/bin
> > > +
> > >   // COMMON-LABEL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
> > > -// CLANG-SAME: "-internal-isystem"
> > "{{.*}}clang/{{.*}}/include/cuda_wrappers"
> > > -// NOCLANG-NOT: "{{.*}}clang/{{.*}}/include/cuda_wrappers"
> > > +// CLANG-SAME: "-internal-isystem"
> > "[[ROOT]]/lib/clang/{{.*}}/include/cuda_wrappers"
> > > +// NOCLANG-NOT: "[[ROOT]]/lib/clang/{{.*}}/include/cuda_wrappers"
> > >   // HIP-SAME: "-internal-isystem" "{{.*}}Inputs/rocm/include"
> > >   // NOHIP-NOT: "{{.*}}Inputs/rocm/include"
> > >   // HIP-SAME: "-include" "__clang_hip_runtime_wrapper.h"
> > >   // NOHIP-NOT: "-include" "__clang_hip_runtime_wrapper.h"
> > >   // skip check of standard C++ include path
> > > -// CLANG-SAME: "-internal-isystem" "{{.*}}clang/{{.*}}/include"
> > > -// NOCLANG-NOT: "{{.*}}clang/{{.*}}/include"
> > > +// CLANG-SAME: "-internal-isystem" "[[ROOT]]/lib/clang/{{.*}}/include"
> > > +// NOCLANG-NOT: "[[ROOT]]/lib/clang/{{.*}}/include"
> > >
> > >   // COMMON-LABEL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
> > > -// CLANG-SAME: "-internal-isystem"
> > "{{.*}}clang/{{.*}}/include/cuda_wrappers"
> > > -// NOCLANG-NOT: "{{.*}}clang/{{.*}}/include/cuda_wrappers"
> > > +// CLANG-SAME: "-internal-isystem"
> > "[[ROOT]]/lib/clang/{{.*}}/include/cuda_wrappers"
> > > +// NOCLANG-NOT: "[[ROOT]]/lib/clang/{{.*}}/include/cuda_wrappers"
> > >   // HIP-SAME: "-internal-isystem" "{{.*}}Inputs/rocm/include"
> > >   // NOHIP-NOT: "{{.*}}Inputs/rocm/include"
> > >   // HIP-SAME: "-include" "__clang_hip_runtime_wrapper.h"
> > >   // NOHIP-NOT: "-include" "__clang_hip_runtime_wrapper.h"
> > >   // skip check of standard C++ include path
> > > -// CLANG-SAME: "-internal-isystem" "{{.*}}clang/{{.*}}/include"
> > > -// NOCLANG-NOT: "{{.*}}clang/{{.*}}/include"
> > > +// CLANG-SAME: "-internal-isystem" "[[ROOT]]/lib/clang/{{.*}}/include"
> > > +// NOCLANG-NOT: "[[ROOT]]/lib/clang/{{.*}}/include"
> > >
> > >   // RUN: %clang -c -### -target x86_64-unknown-linux-gnu --cuda-gpu-
> > arch=gfx900 \
> > >   // RUN:   -std=c++11 --rocm-path=%S/Inputs/rocm -nogpulib %s 2>&1 \
> > >   // RUN:   --hip-version=3.5 | FileCheck -check-prefixes=ROCM35 %s
> > >
> > > +// ROCM35: InstalledDir: [[ROOT:[^"]*]]/bin
> > > +
> > >   // ROCM35-LABEL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
> > > -// ROCM35-NOT: "{{.*}}clang/{{.*}}/include/cuda_wrappers"
> > > -// ROCM35-SAME: "-internal-isystem" "{{[^"]*}}clang/{{[^"]*}}"
> > > +// ROCM35-NOT: "[[ROOT]]/lib/clang/{{.*}}/include/cuda_wrappers"
> > > +// ROCM35-SAME: "-internal-isystem" "[[ROOT]]/lib/clang/{{[^"]*}}"
> > >   // ROCM35-SAME: "-internal-isystem" "{{[^"]*}}Inputs/rocm/include"
> > >   // ROCM35-NOT: "-include" "__clang_hip_runtime_wrapper.h"
> > >   // skip check of standard C++ include path
> > > -// ROCM35-SAME: "-internal-isystem" "{{[^"]*}}clang/{{[^"]*}}/include"
> > > +// ROCM35-SAME: "-internal-isystem"
> "[[ROOT]]/lib/clang/{{.*}}/include"
> > >
> > >
> > >
> > > _______________________________________________
> > > cfe-commits mailing list
> > > cfe-commits at lists.llvm.org
> > > https://protect2.fireeye.com/v1/url?k=d5ad3ea1-8a360643-d5ad7e3a-
> > 86073b36ea28-2691a630c4426a26&q=1&e=735586c1-eff9-470c-aae6-
> > 72947e725d9a&u=https%3A%2F%2Flists.llvm.org%2Fcgi-
> > bin%2Fmailman%2Flistinfo%2Fcfe-commits
> > >



More information about the cfe-commits mailing list