Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abort testing on unsupported dialect flags #1158

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions libcudacxx/test/utils/libcudacxx/test/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ def configure_compile_flags(self):

def configure_default_compile_flags(self):
nvcc_host_compiler = self.get_lit_conf('nvcc_host_compiler')

if nvcc_host_compiler and self.cxx.type == 'nvcc':
self.cxx.compile_flags += ['-ccbin={0}'.format(nvcc_host_compiler)]

Expand Down Expand Up @@ -761,10 +762,20 @@ def configure_default_compile_flags(self):

if std:
# We found a dialect flag.
stdflag = '-std={0}'.format(std)
if self.cxx.type == 'msvc':
self.cxx.compile_flags += ['/std:{0}'.format(std)]
else:
self.cxx.compile_flags += ['-std={0}'.format(std)]
stdflag = '/std:{0}'.format(std)

extraflags = []
if self.cxx.type == 'clang':
extraflags = ['-Wno-unknown-cuda-version']

# Do a check with the user/config flag to ensure that the flag is supported.
if not self.cxx.hasCompileFlag([stdflag] + extraflags):
raise OSError("Configured compiler does not support flag {0}".format(stdflag))

self.cxx.flags += [stdflag]

if not std:
# There is no dialect flag. This happens with older MSVC.
if self.cxx.type == 'nvcc':
Expand Down