Skip to content

Commit d4b42e3

Browse files
committed
Fix comments, add test case for multiple extensions
1 parent e20234c commit d4b42e3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

clang/test/Driver/print-multi-selection-flags.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
// CHECK-V8_1_FP_DP: -mfloat-abi=hard
4141
// CHECK-V8_1_FP_DP: -mfpu=fp-armv8-fullfp16-d16
4242

43+
// RUN: %clang -print-multi-flags-experimental --target=arm-none-eabihf -march=armv8.1m.main+nofp+fp+nofp.dp | FileCheck --check-prefix=CHECK-V8_1_NO_FP_DP %s
44+
// CHECK-V8_1_NO_FP_DP: -march=thumbv8.1m.main{{.*}}
45+
// CHECK-V8_1_NO_FP_DP: -mfloat-abi=hard
46+
// CHECK-V8_1_NO_FP_DP: -mfpu=fp-armv8-fullfp16-sp-d16
47+
4348
// RUN: %clang -print-multi-flags-experimental --target=arm-none-eabihf -mcpu=cortex-m85+nofp.dp | FileCheck --check-prefix=CHECK-M85_NO_FP_DP %s
4449
// CHECK-M85_NO_FP_DP: -march=thumbv8.1m.main{{.*}}
4550
// CHECK-M85_NO_FP_DP: -mfloat-abi=hard

llvm/lib/TargetParser/ARMTargetParser.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ static ARM::FPUKind findDoublePrecisionFPU(ARM::FPUKind InputFPUKind) {
371371

372372
const ARM::FPUName &InputFPU = ARM::FPUNames[InputFPUKind];
373373

374+
// If the input FPU already supports double-precision, then there
375+
// isn't any different FPU we can return here.
374376
if (ARM::isDoublePrecision(InputFPU.Restriction))
375377
return InputFPUKind;
376378

@@ -396,9 +398,8 @@ static ARM::FPUKind findSinglePrecisionFPU(ARM::FPUKind InputFPUKind) {
396398

397399
const ARM::FPUName &InputFPU = ARM::FPUNames[InputFPUKind];
398400

399-
// If the input FPU already supports double-precision, then there
401+
// If the input FPU already is single-precision only, then there
400402
// isn't any different FPU we can return here.
401-
//
402403
if (!ARM::isDoublePrecision(InputFPU.Restriction))
403404
return InputFPUKind;
404405

0 commit comments

Comments
 (0)