[SystemZ][z/OS] Set short-enums as the default for z/OS

This patch sets short-enums to be the default for z/OS.

Reviewed By: abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D89801
This commit is contained in:
Jonathan Crowther 2020-10-22 14:13:26 -04:00 committed by Abhina Sreeskantharajan
parent 156e8b3702
commit 9bc02e892f
2 changed files with 11 additions and 2 deletions

View File

@ -5645,9 +5645,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
(RTTIMode == ToolChain::RM_Disabled)))
CmdArgs.push_back("-fno-rtti");
// -fshort-enums=0 is default for all architectures except Hexagon.
// -fshort-enums=0 is default for all architectures except Hexagon and z/OS.
if (Args.hasFlag(options::OPT_fshort_enums, options::OPT_fno_short_enums,
TC.getArch() == llvm::Triple::hexagon))
TC.getArch() == llvm::Triple::hexagon || Triple.isOSzOS()))
CmdArgs.push_back("-fshort-enums");
RenderCharacterOptions(Args, AuxTriple ? *AuxTriple : RawTriple, CmdArgs);

View File

@ -0,0 +1,9 @@
// RUN: %clang -### --target=s390x-none-zos -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK-SHORT-ENUMS %s
// RUN: %clang -### --target=s390x-none-zos -fno-short-enums -fsyntax-only %s 2>&1 | FileCheck %s
// REQUIRES: clang-driver
//CHECK-SHORT-ENUMS: -fshort-enums
//CHECK-SHORT-ENUMS: -fno-signed-char
//CHECK-NOT: -fshort-enums
//CHECK: -fno-signed-char