Skip to content

Commit

Permalink
[AIX] Define __STDC_NO_ATOMICS__ and __STDC_NO_THREADS__
Browse files Browse the repository at this point in the history
Revert/reapply to fix Git authorship metadata

Differential Revision: https://reviews.llvm.org/D103707
  • Loading branch information
jakeegan authored and cebowler committed Jun 8, 2021
1 parent f97e01e commit f38eff7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clang/lib/Basic/Targets/OSTargets.h
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,11 @@ class AIXTargetInfo : public OSTargetInfo<Target> {

Builder.defineMacro("_AIX");

if (LangStandard::getLangStandardForKind(Opts.LangStd).isC11()) {
Builder.defineMacro("__STDC_NO_ATOMICS__");
Builder.defineMacro("__STDC_NO_THREADS__");
}

if (Opts.EnableAIXExtendedAltivecABI)
Builder.defineMacro("__EXTABI__");

Expand Down
10 changes: 10 additions & 0 deletions clang/test/Preprocessor/init-ppc.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,16 @@
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX-NOTHREADSAFE %s
// PPC-AIX-NOTHREADSAFE-NOT:#define _THREAD_SAFE 1

// RUN: %clang_cc1 -x c -std=c11 -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX-STDC %s
// RUN: %clang_cc1 -x c -std=gnu11 -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX-STDC %s
// RUN: %clang_cc1 -x c -std=c17 -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX-STDC %s
// PPC-AIX-STDC:#define __STDC_NO_ATOMICS__ 1
// PPC-AIX-STDC:#define __STDC_NO_THREADS__ 1

// RUN: %clang_cc1 -x c -std=c99 -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX-STDC-N %s
// PPC-AIX-STDC-N-NOT:#define __STDC_NO_ATOMICS__ 1
// PPC-AIX-STDC-N-NOT:#define __STDC_NO_THREADS__ 1

// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-unknown-linux-gnu -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC-LINUX %s
//
// PPC-LINUX:#define _ARCH_PPC 1
Expand Down

0 comments on commit f38eff7

Please sign in to comment.