forked from OSchip/llvm-project
Add tests for clang -fno-zero-initialized-in-bss and llc -nozero-initialized-in-bss
And rename the CC1 option.
This commit is contained in:
parent
68e07da3e5
commit
aed6a1b137
|
@ -307,8 +307,6 @@ def mlimit_float_precision : Separate<["-"], "mlimit-float-precision">,
|
|||
HelpText<"Limit float precision to the given value">;
|
||||
def split_stacks : Flag<["-"], "split-stacks">,
|
||||
HelpText<"Try to use a split stack if possible.">;
|
||||
def mno_zero_initialized_in_bss : Flag<["-"], "mno-zero-initialized-in-bss">,
|
||||
HelpText<"Do not put zero initialized data in the BSS">;
|
||||
def mregparm : Separate<["-"], "mregparm">,
|
||||
HelpText<"Limit the number of registers available for integer arguments">;
|
||||
def msmall_data_limit : Separate<["-"], "msmall-data-limit">,
|
||||
|
|
|
@ -1589,7 +1589,6 @@ def fno_unwind_tables : Flag<["-"], "fno-unwind-tables">, Group<f_Group>;
|
|||
def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group<f_Group>, Flags<[CC1Option]>;
|
||||
def fno_working_directory : Flag<["-"], "fno-working-directory">, Group<f_Group>;
|
||||
def fno_wrapv : Flag<["-"], "fno-wrapv">, Group<f_Group>;
|
||||
def fno_zero_initialized_in_bss : Flag<["-"], "fno-zero-initialized-in-bss">, Group<f_Group>;
|
||||
def fobjc_arc : Flag<["-"], "fobjc-arc">, Group<f_Group>, Flags<[CC1Option]>,
|
||||
HelpText<"Synthesize retain and release calls for Objective-C pointers">;
|
||||
def fno_objc_arc : Flag<["-"], "fno-objc-arc">, Group<f_Group>;
|
||||
|
@ -1926,7 +1925,7 @@ def fwrapv : Flag<["-"], "fwrapv">, Group<f_Group>, Flags<[CC1Option]>,
|
|||
HelpText<"Treat signed integer overflow as two's complement">;
|
||||
def fwritable_strings : Flag<["-"], "fwritable-strings">, Group<f_Group>, Flags<[CC1Option]>,
|
||||
HelpText<"Store string literals as writable data">;
|
||||
def fzero_initialized_in_bss : Flag<["-"], "fzero-initialized-in-bss">, Group<f_Group>;
|
||||
defm zero_initialized_in_bss : OptOutFFlag<"zero-initialized-in-bss", "", "Don't place zero initialized data in BSS">;
|
||||
defm function_sections : OptInFFlag<"function-sections", "Place each function in its own section">;
|
||||
def fbasic_block_sections_EQ : Joined<["-"], "fbasic-block-sections=">, Group<f_Group>,
|
||||
Flags<[CC1Option, CC1AsOption]>,
|
||||
|
|
|
@ -4556,8 +4556,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
CmdArgs.push_back(FPKeepKindStr);
|
||||
|
||||
if (!Args.hasFlag(options::OPT_fzero_initialized_in_bss,
|
||||
options::OPT_fno_zero_initialized_in_bss))
|
||||
CmdArgs.push_back("-mno-zero-initialized-in-bss");
|
||||
options::OPT_fno_zero_initialized_in_bss, true))
|
||||
CmdArgs.push_back("-fno-zero-initialized-in-bss");
|
||||
|
||||
bool OFastEnabled = isOptimizationLevelFast(Args);
|
||||
// If -Ofast is the optimization level, then -fstrict-aliasing should be
|
||||
|
|
|
@ -942,7 +942,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
|
|||
Opts.StrictFloatCastOverflow =
|
||||
!Args.hasArg(OPT_fno_strict_float_cast_overflow);
|
||||
|
||||
Opts.NoZeroInitializedInBSS = Args.hasArg(OPT_mno_zero_initialized_in_bss);
|
||||
Opts.NoZeroInitializedInBSS = Args.hasArg(OPT_fno_zero_initialized_in_bss);
|
||||
Opts.NumRegisterParameters = getLastArgIntValue(Args, OPT_mregparm, 0, Diags);
|
||||
Opts.NoExecStack = Args.hasArg(OPT_mno_exec_stack);
|
||||
Opts.SmallDataLimit =
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// RUN: %clang -### %s -c -fzero-initialized-in-bss 2>&1 | FileCheck %s --check-prefix=NO
|
||||
// RUN: %clang -### %s -c 2>&1 | FileCheck %s --check-prefix=NO
|
||||
|
||||
// NO-NOT: -fno-zero-initialized-in-bss
|
||||
|
||||
// RUN: %clang -### %s -c -fzero-initialized-in-bss -fno-zero-initialized-in-bss 2>&1 | FileCheck %s
|
||||
|
||||
// CHECK: -fno-zero-initialized-in-bss
|
|
@ -0,0 +1,16 @@
|
|||
; RUN: llc < %s -mtriple=x86_64 | FileCheck %s --check-prefix=BSS
|
||||
|
||||
; BSS: .bss
|
||||
; BSS-NEXT: .globl a
|
||||
; BSS: .section .tbss,"awT",@nobits
|
||||
; BSS-NEXT: .globl b
|
||||
|
||||
; RUN: llc < %s -mtriple=x86_64 -nozero-initialized-in-bss | FileCheck %s --check-prefix=DATA
|
||||
|
||||
; DATA: .data
|
||||
; DATA-NEXT: .globl a
|
||||
; DATA: .section .tdata,"awT",@progbits
|
||||
; DATA-NEXT: .globl b
|
||||
|
||||
@a = global i32 0
|
||||
@b = thread_local global i32 0
|
Loading…
Reference in New Issue