Skip to content

Commit 8ad5395

Browse files
[PowerPC] fix float ABI selection on ppcle
1 parent 78bf682 commit 8ad5395

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ createTargetCodeGenInfo(CodeGenModule &CGM) {
188188
return createPPC32TargetCodeGenInfo(CGM, IsSoftFloat);
189189
}
190190
case llvm::Triple::ppcle: {
191-
bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
191+
bool IsSoftFloat =
192+
CodeGenOpts.FloatABI == "soft" || Target.hasFeature("spe");
192193
return createPPC32TargetCodeGenInfo(CGM, IsSoftFloat);
193194
}
194195
case llvm::Triple::ppc64:

clang/test/CodeGen/PowerPC/ppc-sfvarargs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// RUN: %clang -O0 --target=powerpc-unknown-linux-gnu -EB -msoft-float -S -emit-llvm %s -o - | FileCheck %s
2+
// RUN: %clang -O0 --target=powerpcle-unknown-linux-gnu -EL -msoft-float -S -emit-llvm %s -o - | FileCheck %s
3+
// RUN: %clang -O0 --target=powerpcle-unknown-unknown -mcpu=e500 -mhard-float -S -emit-llvm %s -o - | FileCheck %s
4+
// RUN: %clang -O0 --target=powerpc-unknown-unknown -mcpu=e500 -mhard-float -S -emit-llvm %s -o - | FileCheck %s
25

36
#include <stdarg.h>
47
void test(char *fmt, ...) {

0 commit comments

Comments
 (0)