Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -3418,7 +3418,7 @@ HelpText<"Enable or disable Control Flow Guard checks and guard tables emission">, Values<"none,cf,cf-nochecks">; def mcpu_EQ : Joined<["-"], "mcpu=">, Group; -def mmcu_EQ : Joined<["-"], "mmcu=">, Group; +def mmcu_EQ : Joined<["-"], "mmcu=">, Group, Alias; def msim : Flag<["-"], "msim">, Group; def mdynamic_no_pic : Joined<["-"], "mdynamic-no-pic">, Group; def mfix_and_continue : Flag<["-"], "mfix-and-continue">, Group; Index: clang/lib/Driver/ToolChains/CommonArgs.cpp =================================================================== --- clang/lib/Driver/ToolChains/CommonArgs.cpp +++ clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -382,7 +382,7 @@ } case llvm::Triple::avr: - if (const Arg *A = Args.getLastArg(options::OPT_mmcu_EQ)) + if (const Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) return A->getValue(); return ""; Index: clang/lib/Driver/ToolChains/MSP430.cpp =================================================================== --- clang/lib/Driver/ToolChains/MSP430.cpp +++ clang/lib/Driver/ToolChains/MSP430.cpp @@ -43,7 +43,7 @@ static StringRef getHWMultLib(const ArgList &Args) { StringRef HWMult = Args.getLastArgValue(options::OPT_mhwmult_EQ, "auto"); if (HWMult == "auto") { - HWMult = getSupportedHWMult(Args.getLastArg(options::OPT_mmcu_EQ)); + HWMult = getSupportedHWMult(Args.getLastArg(options::OPT_mcpu_EQ)); } return llvm::StringSwitch(HWMult) @@ -55,7 +55,7 @@ void msp430::getMSP430TargetFeatures(const Driver &D, const ArgList &Args, std::vector &Features) { - const Arg *MCU = Args.getLastArg(options::OPT_mmcu_EQ); + const Arg *MCU = Args.getLastArg(options::OPT_mcpu_EQ); if (MCU && !isSupportedMCU(MCU->getValue())) { D.Diag(diag::err_drv_clang_unsupported) << MCU->getValue(); return; @@ -161,7 +161,7 @@ Action::OffloadKind) const { CC1Args.push_back("-nostdsysteminc"); - const auto *MCUArg = DriverArgs.getLastArg(options::OPT_mmcu_EQ); + const auto *MCUArg = DriverArgs.getLastArg(options::OPT_mcpu_EQ); if (!MCUArg) return; @@ -248,7 +248,7 @@ return; } - const Arg *MCUArg = Args.getLastArg(options::OPT_mmcu_EQ); + const Arg *MCUArg = Args.getLastArg(options::OPT_mcpu_EQ); if (!MCUArg) return; Index: clang/test/Driver/avr-mmcu.c =================================================================== --- clang/test/Driver/avr-mmcu.c +++ clang/test/Driver/avr-mmcu.c @@ -1,81 +1,81 @@ -// A test for the propagation of the -mmcu option to -cc1 and -cc1as +// A test for the propagation of the -mmcu/-mcpu option to -cc1 and -cc1as // RUN: %clang -### --target=avr -mmcu=attiny11 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK0 %s +// RUN: %clang -### --target=avr -mcpu=attiny11 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK0 %s // CHECK0: "-cc1" {{.*}} "-target-cpu" "attiny11" // CHECK0: "-cc1as" {{.*}} "-target-cpu" "attiny11" // RUN: %clang -### --target=avr -mmcu=at90s2313 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK1 %s +// RUN: %clang -### --target=avr -mcpu=at90s2313 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK1 %s // CHECK1: "-cc1" {{.*}} "-target-cpu" "at90s2313" // CHECK1: "-cc1as" {{.*}} "-target-cpu" "at90s2313" // RUN: %clang -### --target=avr -mmcu=at90s8515 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK2 %s +// RUN: %clang -### --target=avr -mcpu=at90s8515 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK2 %s // CHECK2: "-cc1" {{.*}} "-target-cpu" "at90s8515" // CHECK2: "-cc1as" {{.*}} "-target-cpu" "at90s8515" // RUN: %clang -### --target=avr -mmcu=attiny13a -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK3 %s +// RUN: %clang -### --target=avr -mcpu=attiny13a -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK3 %s // CHECK3: "-cc1" {{.*}} "-target-cpu" "attiny13a" // CHECK3: "-cc1as" {{.*}} "-target-cpu" "attiny13a" // RUN: %clang -### --target=avr -mmcu=attiny88 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK4 %s +// RUN: %clang -### --target=avr -mcpu=attiny88 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK4 %s // CHECK4: "-cc1" {{.*}} "-target-cpu" "attiny88" // CHECK4: "-cc1as" {{.*}} "-target-cpu" "attiny88" -// RUN: %clang -### --target=avr -mmcu=attiny88 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK5 %s -// CHECK5: "-cc1" {{.*}} "-target-cpu" "attiny88" -// CHECK5: "-cc1as" {{.*}} "-target-cpu" "attiny88" - // RUN: %clang -### --target=avr -mmcu=atmega8u2 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK6 %s +// RUN: %clang -### --target=avr -mcpu=atmega8u2 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK6 %s // CHECK6: "-cc1" {{.*}} "-target-cpu" "atmega8u2" // CHECK6: "-cc1as" {{.*}} "-target-cpu" "atmega8u2" -// RUN: %clang -### --target=avr -mmcu=atmega8u2 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK7 %s -// CHECK7: "-cc1" {{.*}} "-target-cpu" "atmega8u2" -// CHECK7: "-cc1as" {{.*}} "-target-cpu" "atmega8u2" - // RUN: %clang -### --target=avr -mmcu=atmega8a -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK8 %s +// RUN: %clang -### --target=avr -mcpu=atmega8a -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK8 %s // CHECK8: "-cc1" {{.*}} "-target-cpu" "atmega8a" // CHECK8: "-cc1as" {{.*}} "-target-cpu" "atmega8a" -// RUN: %clang -### --target=avr -mmcu=atmega8a -save-temps %s 2>&1 | FileCheck -check-prefix=CHECK9 %s -// CHECK9: "-cc1" {{.*}} "-target-cpu" "atmega8a" -// CHECK9: "-cc1as" {{.*}} "-target-cpu" "atmega8a" - // RUN: %clang -### --target=avr -mmcu=atmega16a -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKa %s +// RUN: %clang -### --target=avr -mcpu=atmega16a -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKa %s // CHECKa: "-cc1" {{.*}} "-target-cpu" "atmega16a" // CHECKa: "-cc1as" {{.*}} "-target-cpu" "atmega16a" -// RUN: %clang -### --target=avr -mmcu=atmega16a -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKb %s -// CHECKb: "-cc1" {{.*}} "-target-cpu" "atmega16a" -// CHECKb: "-cc1as" {{.*}} "-target-cpu" "atmega16a" - // RUN: %clang -### --target=avr -mmcu=atmega128a -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKc %s +// RUN: %clang -### --target=avr -mcpu=atmega128a -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKc %s // CHECKc: "-cc1" {{.*}} "-target-cpu" "atmega128a" // CHECKc: "-cc1as" {{.*}} "-target-cpu" "atmega128a" // RUN: %clang -### --target=avr -mmcu=atmega2560 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKd %s +// RUN: %clang -### --target=avr -mcpu=atmega2560 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKd %s // CHECKd: "-cc1" {{.*}} "-target-cpu" "atmega2560" // CHECKd: "-cc1as" {{.*}} "-target-cpu" "atmega2560" // RUN: %clang -### --target=avr -mmcu=attiny10 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKe %s +// RUN: %clang -### --target=avr -mcpu=attiny10 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKe %s // CHECKe: "-cc1" {{.*}} "-target-cpu" "attiny10" // CHECKe: "-cc1as" {{.*}} "-target-cpu" "attiny10" // RUN: %clang -### --target=avr -mmcu=atxmega16a4 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKf %s +// RUN: %clang -### --target=avr -mcpu=atxmega16a4 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKf %s // CHECKf: "-cc1" {{.*}} "-target-cpu" "atxmega16a4" // CHECKf: "-cc1as" {{.*}} "-target-cpu" "atxmega16a4" // RUN: %clang -### --target=avr -mmcu=atxmega64b1 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKg %s +// RUN: %clang -### --target=avr -mcpu=atxmega64b1 -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKg %s // CHECKg: "-cc1" {{.*}} "-target-cpu" "atxmega64b1" // CHECKg: "-cc1as" {{.*}} "-target-cpu" "atxmega64b1" // RUN: %clang -### --target=avr -mmcu=atxmega64a1u -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKh %s +// RUN: %clang -### --target=avr -mcpu=atxmega64a1u -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKh %s // CHECKh: "-cc1" {{.*}} "-target-cpu" "atxmega64a1u" // CHECKh: "-cc1as" {{.*}} "-target-cpu" "atxmega64a1u" // RUN: %clang -### --target=avr -mmcu=atxmega128a3u -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKj %s +// RUN: %clang -### --target=avr -mcpu=atxmega128a3u -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKj %s // CHECKj: "-cc1" {{.*}} "-target-cpu" "atxmega128a3u" // CHECKj: "-cc1as" {{.*}} "-target-cpu" "atxmega128a3u" // RUN: %clang -### --target=avr -mmcu=atxmega128a4u -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKi %s +// RUN: %clang -### --target=avr -mcpu=atxmega128a4u -save-temps %s 2>&1 | FileCheck -check-prefix=CHECKi %s // CHECKi: "-cc1" {{.*}} "-target-cpu" "atxmega128a4u" // CHECKi: "-cc1as" {{.*}} "-target-cpu" "atxmega128a4u" Index: clang/test/Driver/msp430-toolchain.c =================================================================== --- clang/test/Driver/msp430-toolchain.c +++ clang/test/Driver/msp430-toolchain.c @@ -206,6 +206,9 @@ // RUN: %clang -### %s --target=msp430 -mmcu=msp430g2553 \ // RUN: --sysroot=%S/Inputs/basic_msp430_tree 2>&1 \ // RUN: | FileCheck -check-prefix=LD-SCRIPT %s +// RUN: %clang -### %s --target=msp430 -mcpu=msp430g2553 \ +// RUN: --sysroot=%S/Inputs/basic_msp430_tree 2>&1 \ +// RUN: | FileCheck -check-prefix=LD-SCRIPT %s // LD-SCRIPT: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}msp430-elf-ld" // LD-SCRIPT: "-L{{.*}}/Inputs/basic_msp430_tree{{/|\\\\}}include" // LD-SCRIPT: "-Tmsp430g2553.ld" @@ -214,6 +217,10 @@ // RUN: --sysroot=%S/Inputs/basic_msp430_tree \ // RUN: -T custom_script.ld 2>&1 \ // RUN: | FileCheck -check-prefix=CUSTOM-LD-SCRIPT %s +// RUN: %clang -### %s --target=msp430 -mcpu=msp430g2553 \ +// RUN: --sysroot=%S/Inputs/basic_msp430_tree \ +// RUN: -T custom_script.ld 2>&1 \ +// RUN: | FileCheck -check-prefix=CUSTOM-LD-SCRIPT %s // CUSTOM-LD-SCRIPT: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}msp430-elf-ld" // CUSTOM-LD_SCRIPT-NOT: "-Tmsp430g2553.ld" // CUSTOM-LD-SCRIPT: "-T" "custom_script.ld" @@ -223,6 +230,8 @@ // RUN: %clang -### %s --target=msp430 -mmcu=msp430g2553 \ // RUN: -msim -rtlib=libgcc --sysroot=%S/Inputs/basic_msp430_tree > %t 2>&1 +// RUN: %clang -### %s --target=msp430 -mcpu=msp430g2553 \ +// RUN: -msim -rtlib=libgcc --sysroot=%S/Inputs/basic_msp430_tree > %t 2>&1 // RUN: FileCheck -check-prefix=SIMULATOR-POS %s < %t // RUN: FileCheck -check-prefix=SIMULATOR-NEG %s < %t // SIMULATOR-POS: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}msp430-elf-ld"