Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions clang/lib/Driver/ToolChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,17 @@ static void getAArch64MultilibFlags(const Driver &D,
Result.push_back(BranchProtectionArg->getAsString(Args));
}

const Arg *StrictAlignArg = Args.getLastArgNoClaim(
options::OPT_mstrict_align, options::OPT_mno_unaligned_access);
if (StrictAlignArg) {
Result.push_back(StrictAlignArg->getAsString(Args));
}

const Arg *BigEndian = Args.getLastArgNoClaim(options::OPT_mbig_endian);
if (BigEndian) {
Result.push_back(BigEndian->getAsString(Args));
}

const Arg *ABIArg = Args.getLastArgNoClaim(options::OPT_mabi_EQ);
if (ABIArg) {
Result.push_back(ABIArg->getAsString(Args));
Expand Down Expand Up @@ -287,6 +298,17 @@ static void getARMMultilibFlags(const Driver &D,
if (BranchProtectionArg) {
Result.push_back(BranchProtectionArg->getAsString(Args));
}

const Arg *StrictAlignArg = Args.getLastArgNoClaim(
options::OPT_mstrict_align, options::OPT_mno_unaligned_access);
if (StrictAlignArg) {
Result.push_back(StrictAlignArg->getAsString(Args));
}

const Arg *BigEndian = Args.getLastArgNoClaim(options::OPT_mbig_endian);
if (BigEndian) {
Result.push_back(BigEndian->getAsString(Args));
}
}

static void getRISCVMultilibFlags(const Driver &D, const llvm::Triple &Triple,
Expand Down
8 changes: 8 additions & 0 deletions clang/test/Driver/print-multi-selection-flags.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@
// RUN: %clang -multi-lib-config=%S/Inputs/multilib/empty.yaml -print-multi-flags-experimental --target=aarch64-none-elf -mbranch-protection=standard | FileCheck --check-prefix=CHECK-BRANCH-PROTECTION %s
// CHECK-BRANCH-PROTECTION: -mbranch-protection=standard

// RUN: %clang -multi-lib-config=%S/Inputs/multilib/empty.yaml -print-multi-flags-experimental --target=arm-none-eabi -mno-unaligned-access | FileCheck --check-prefix=CHECK-NO-UNALIGNED-ACCESS %s
// RUN: %clang -multi-lib-config=%S/Inputs/multilib/empty.yaml -print-multi-flags-experimental --target=aarch64-none-elf -mno-unaligned-access | FileCheck --check-prefix=CHECK-NO-UNALIGNED-ACCESS %s
// CHECK-NO-UNALIGNED-ACCESS: -mno-unaligned-access

// RUN: %clang -multi-lib-config=%S/Inputs/multilib/empty.yaml -print-multi-flags-experimental --target=arm-none-eabi -mbig-endian | FileCheck --check-prefix=CHECK-BIG-ENDIAN %s
// RUN: %clang -multi-lib-config=%S/Inputs/multilib/empty.yaml -print-multi-flags-experimental --target=aarch64-none-elf -mbig-endian | FileCheck --check-prefix=CHECK-BIG-ENDIAN %s
// CHECK-BIG-ENDIAN: -mbig-endian

// RUN: %clang -multi-lib-config=%S/Inputs/multilib/empty.yaml -print-multi-flags-experimental --target=riscv32-none-elf -march=rv32g | FileCheck --check-prefix=CHECK-RV32 %s
// CHECK-RV32: --target=riscv32-unknown-none-elf
// CHECK-RV32: -mabi=ilp32d
Expand Down
Loading