When Clang is used as a cross compiler, it should respect the target platform default. Defaulting to a configure-time CLANG_DEFAULT_STD_C/CLANG_DEFAULT_STD_CXX does not make much sense. When Clang is used as a single-platform compiler, we should use Clang configuration file (https://discourse.llvm.org/t/configuration-files/42529 https://clang.llvm.org/docs/UsersManual.html#configuration-files). The Gentoo needs from D34365 has been satisfied by a configuration file. Reviewed By: mgorny Differential Revision: https://reviews.llvm.org/D133375
15 lines
579 B
C++
15 lines
579 B
C++
// UNSUPPORTED: ps4, ps5
|
|
/// Test default standards.
|
|
/// PS4/PS5 default to gnu++14.
|
|
|
|
// RUN: %clang_cc1 -dM -E %s | FileCheck --check-prefix=CXX17 %s
|
|
// RUN: %clang_cc1 -dM -E -x cuda %s | FileCheck --check-prefix=CXX14 %s
|
|
// RUN: %clang_cc1 -dM -E -x hip %s | FileCheck --check-prefix=CXX14 %s
|
|
|
|
// RUN: %clang_cc1 -dM -E -x cuda -std=c++14 %s | FileCheck --check-prefix=CXX14 %s
|
|
// RUN: %clang_cc1 -dM -E -x hip -std=c++98 %s | FileCheck --check-prefix=CXX98 %s
|
|
|
|
// CXX98: #define __cplusplus 199711L
|
|
// CXX14: #define __cplusplus 201402L
|
|
// CXX17: #define __cplusplus 201703L
|