Zequan Wu 15a3ae1ab1 [Clang] Add __STDCPP_THREADS__ to standard predefine macros
According to https://eel.is/c++draft/cpp.predefined#2.6, `__STDCPP_THREADS__` is a predefined macro.

Differential Revision: https://reviews.llvm.org/D91747
2020-11-22 16:05:53 -08:00

18 lines
557 B
C++

// RUN: split-file %s %t.dir
// RUN: %clang_cc1 -verify %t.dir/defined.cpp
// RUN: %clang_cc1 -verify -mthread-model posix %t.dir/defined.cpp
// RUN: %clang_cc1 -verify -mthread-model single %t.dir/not-defined.cpp
// RUN: %clang_cc1 -verify -x c %t.dir/not-defined.cpp
//--- defined.cpp
// expected-no-diagnostics
#ifndef __STDCPP_THREADS__
#error __STDCPP_THREADS__ is not defined in posix thread model.
#endif
//--- not-defined.cpp
// expected-no-diagnostics
#ifdef __STDCPP_THREADS__
#error __STDCPP_THREADS__ is defined in single thread model.
#endif