Skip to content

[Tests] Improve tests about warning-free SYCL headers #15081

@AlexeySachkov

Description

@AlexeySachkov

Is your feature request related to a problem? Please describe

This is prompted by discussion we had in #15064: we already have some testing to check that SYCL headers are warning-free, but it can always be improved. In particular, we allow to use a 3rd party compiler to build host part of SYCL applications and in that phase/mode SYCL headers are not considered to be system headers, so any warnings coming out of them may break -Werror builds or just annoy users polluting their build logs.

Describe the solution you would like

As a first step, we should copy existing warnings.cpp test and compile it using gcc instead of clang++:

// RUN: %clangxx -fsycl --no-system-header-prefix=sycl -fsyntax-only -Wall -Wextra -Werror -Wno-ignored-attributes -Wno-deprecated-declarations -Wpessimizing-move -Wmismatched-tags -Wno-unknown-cuda-version -Wno-unused-command-line-argument %s
// RUN: %clangxx -fsycl -E --no-system-header-prefix=sycl %s -o %t.ii
// RUN: %clangxx -fsycl -fsyntax-only -Wall -Wextra -Werror -Wno-ignored-attributes -Wno-deprecated-declarations -Wpessimizing-move -Wmismatched-tags -Wno-unknown-cuda-version -Wno-unused-command-line-argument %t.ii

Going forward, this (and existing) tests could be further expanded, but having a test with gcc would be already a good start.

Describe alternatives you have considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions