Index: lib/Target/Nios2/MCTargetDesc/Nios2MCTargetDesc.cpp =================================================================== --- lib/Target/Nios2/MCTargetDesc/Nios2MCTargetDesc.cpp +++ lib/Target/Nios2/MCTargetDesc/Nios2MCTargetDesc.cpp @@ -46,7 +46,7 @@ static MCSubtargetInfo * createNios2MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS) { if (CPU.empty() || CPU == "generic") { - CPU == "nios2r1"; + CPU = "nios2r1"; } return createNios2MCSubtargetInfoImpl(TT, CPU, FS); Index: test/CodeGen/Nios2/proc_support.ll =================================================================== --- /dev/null +++ test/CodeGen/Nios2/proc_support.ll @@ -0,0 +1,10 @@ +; This tests that llc accepts Nios2 processors. + +; RUN: not not llc < %s -asm-verbose=false -march=nios2 -mcpu=nios2r1 2>&1 | FileCheck %s --check-prefix=ARCH +; RUN: not not llc < %s -asm-verbose=false -march=nios2 -mcpu=nios2r2 2>&1 | FileCheck %s --check-prefix=ARCH + +; ARCH-NOT: is not a recognized processor + +define i32 @f(i32 %i) { + ret i32 %i +} Index: test/CodeGen/Nios2/ret_generated.ll =================================================================== --- test/CodeGen/Nios2/ret_generated.ll +++ test/CodeGen/Nios2/ret_generated.ll @@ -1,4 +1,4 @@ -; This tests that llc accepts Nios2 target. +; This tests that llc generates 'ret' instruction in assembly output. ; RUN: llc < %s -march=nios2 2>&1 | FileCheck %s --check-prefix=ARCH