зеркало из https://github.com/microsoft/clang-1.git
PR3589: Don't simplify libcalls with -ffreestanding.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64599 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
669c0e13d3
Коммит
3ada6ffd92
|
@ -1271,7 +1271,7 @@ static void InitializeCompileOptions(CompileOptions &Opts) {
|
||||||
// FIXME: There are llvm-gcc options to control these selectively.
|
// FIXME: There are llvm-gcc options to control these selectively.
|
||||||
Opts.InlineFunctions = (Opts.OptimizationLevel > 1);
|
Opts.InlineFunctions = (Opts.OptimizationLevel > 1);
|
||||||
Opts.UnrollLoops = (Opts.OptimizationLevel > 1 && !OptSize);
|
Opts.UnrollLoops = (Opts.OptimizationLevel > 1 && !OptSize);
|
||||||
Opts.SimplifyLibCalls = 1;
|
Opts.SimplifyLibCalls = !Freestanding;
|
||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
Opts.VerifyModule = 0;
|
Opts.VerifyModule = 0;
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
// RUN: clang -emit-llvm %s -o - | grep 'declare i32 @printf' | count 1 &&
|
||||||
|
// RUN: clang -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 1 &&
|
||||||
|
// RUN: clang -ffreestanding -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 0
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
void f0() {
|
||||||
|
printf("hello\n");
|
||||||
|
}
|
Загрузка…
Ссылка в новой задаче