[PATCH] D103587: [AIX] Transfer predefined macros

Chris Bowler via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 3 10:22:35 PDT 2021


cebowleratibm requested changes to this revision.
cebowleratibm added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/lib/Basic/Targets/OSTargets.h:680
+
+    if (Opts.LangStd == LangStandard::lang_c11 ||
+        Opts.LangStd == LangStandard::lang_gnu11) {
----------------
Should set these macros in C11 and higher levels.


================
Comment at: clang/test/Preprocessor/init-ppc.c:544
 // PPC-AIX:#define __SIZE_WIDTH__ 32
+// PPC-AIX-NOT:#define __STDC_NO_ATOMICS__ 1
+// PPC-AIX-NOT:#define __STDC_NO_THREADS__ 1
----------------
I think it's sufficient to test the __STDC_NO_ATOMICS__ and __STDC_NO_THREADS__ only as you've added below where the -std is explicitly controlled.  I prefer to avoid expecting these macros for the -std default, which may change.


================
Comment at: clang/test/Preprocessor/init-ppc.c:729
 
+// 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=c1x -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
----------------
suggest adding the negative test for pre C11 modes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103587/new/

https://reviews.llvm.org/D103587



More information about the cfe-commits mailing list