mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 01:07:04 +08:00
[clang] OpenBSD does not support C11 atomics or threads.
This commit is contained in:
@@ -462,6 +462,11 @@ protected:
|
||||
Builder.defineMacro("__FLOAT128__");
|
||||
}
|
||||
|
||||
if (Opts.C11) {
|
||||
Builder.defineMacro("__STDC_NO_ATOMICS__");
|
||||
Builder.defineMacro("__STDC_NO_THREADS__");
|
||||
}
|
||||
|
||||
public:
|
||||
OpenBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
|
||||
: OSTargetInfo<Target>(Triple, Opts) {
|
||||
|
||||
@@ -1464,6 +1464,16 @@
|
||||
// OPENBSD:#define __WCHAR_TYPE__ int
|
||||
// OPENBSD:#define __WINT_TYPE__ int
|
||||
//
|
||||
// RUN: %clang_cc1 -x c -std=c11 -E -dM -ffreestanding -triple=amd64-unknown-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD-STDC %s
|
||||
// RUN: %clang_cc1 -x c -std=gnu11 -E -dM -ffreestanding -triple=amd64-unknown-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD-STDC %s
|
||||
// RUN: %clang_cc1 -x c -std=c17 -E -dM -ffreestanding -triple=amd64-unknown-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD-STDC %s
|
||||
// OPENBSD-STDC:#define __STDC_NO_ATOMICS__ 1
|
||||
// OPENBSD-STDC:#define __STDC_NO_THREADS__ 1
|
||||
//
|
||||
// RUN: %clang_cc1 -x c -std=c99 -E -dM -ffreestanding -triple=amd64-unknown-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD-STDC-N %s
|
||||
// OPENBSD-STDC-N-NOT:#define __STDC_NO_ATOMICS__ 1
|
||||
// OPENBSD-STDC-N-NOT:#define __STDC_NO_THREADS__ 1
|
||||
//
|
||||
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=xcore-none-none < /dev/null | FileCheck -match-full-lines -check-prefix XCORE %s
|
||||
// XCORE:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
|
||||
// XCORE:#define __LITTLE_ENDIAN__ 1
|
||||
|
||||
Reference in New Issue
Block a user