[llvm] r251295 - [mips] Check for the correct error message in tests for interrupt attributes.
Vasileios Kalintiris via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 26 07:24:30 PDT 2015
Author: vkalintiris
Date: Mon Oct 26 09:24:30 2015
New Revision: 251295
URL: http://llvm.org/viewvc/llvm-project?rev=251295&view=rev
Log:
[mips] Check for the correct error message in tests for interrupt attributes.
Instead of XFAIL-ing the tests with the wrong usage of the "interrupt"
attribute, we should check that we emit the correct error messages to
the user.
Added:
llvm/trunk/test/CodeGen/Mips/interrupt-attr-64-error.ll
llvm/trunk/test/CodeGen/Mips/interrupt-attr-args-error.ll
llvm/trunk/test/CodeGen/Mips/interrupt-attr-error.ll
Removed:
llvm/trunk/test/CodeGen/Mips/interrupt-attr-64-fail.ll
llvm/trunk/test/CodeGen/Mips/interrupt-attr-args-fail.ll
llvm/trunk/test/CodeGen/Mips/interrupt-attr-fail.ll
Modified:
llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
llvm/trunk/lib/Target/Mips/MipsSEFrameLowering.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=251295&r1=251294&r2=251295&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Mon Oct 26 09:24:30 2015
@@ -2952,9 +2952,9 @@ MipsTargetLowering::LowerFormalArguments
const Function *Func = DAG.getMachineFunction().getFunction();
Function::const_arg_iterator FuncArg = Func->arg_begin();
- if (Func->hasFnAttribute("interrupt"))
- assert(Func->arg_empty() &&
- "Functions with the interrupt attribute cannot have arguments!");
+ if (Func->hasFnAttribute("interrupt") && !Func->arg_empty())
+ report_fatal_error(
+ "Functions with the interrupt attribute cannot have arguments!");
CCInfo.AnalyzeFormalArguments(Ins, CC_Mips_FixedArg);
MipsFI->setFormalArgInfo(CCInfo.getNextStackOffset(),
Modified: llvm/trunk/lib/Target/Mips/MipsSEFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSEFrameLowering.cpp?rev=251295&r1=251294&r2=251295&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsSEFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsSEFrameLowering.cpp Mon Oct 26 09:24:30 2015
@@ -548,8 +548,8 @@ void MipsSEFrameLowering::emitInterruptP
// clearing is not provided so reject that configuration.
if (!STI.hasMips32r2())
report_fatal_error(
- "\"interrupt\" attribute is not supported on pre-r2 MIPS or"
- "Mips16 targets.");
+ "\"interrupt\" attribute is not supported on pre-MIPS32R2 or "
+ "MIPS16 targets.");
// The GP register contains the "user" value, so we cannot perform
// any gp relative loads until we restore the "kernel" or "system" gp
@@ -561,7 +561,7 @@ void MipsSEFrameLowering::emitInterruptP
if (!STI.isABI_O32() || STI.hasMips64())
report_fatal_error("\"interrupt\" attribute is only supported for the "
- "O32 ABI on MIPS32r2+ at the present time.");
+ "O32 ABI on MIPS32R2+ at the present time.");
// Perform ISR handling like GCC
StringRef IntKind =
Added: llvm/trunk/test/CodeGen/Mips/interrupt-attr-64-error.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/interrupt-attr-64-error.ll?rev=251295&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/interrupt-attr-64-error.ll (added)
+++ llvm/trunk/test/CodeGen/Mips/interrupt-attr-64-error.ll Mon Oct 26 09:24:30 2015
@@ -0,0 +1,9 @@
+; RUN: not llc -mcpu=mips64r6 -march=mipsel -relocation-model=static < %s 2>%t
+; RUN: FileCheck %s < %t
+
+; CHECK: LLVM ERROR: "interrupt" attribute is only supported for the O32 ABI on MIPS32R2+ at the present time.
+define i32 @isr_sw0() #0 {
+ ret i32 0
+}
+
+attributes #0 = { "interrupt"="sw0" }
Removed: llvm/trunk/test/CodeGen/Mips/interrupt-attr-64-fail.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/interrupt-attr-64-fail.ll?rev=251294&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/interrupt-attr-64-fail.ll (original)
+++ llvm/trunk/test/CodeGen/Mips/interrupt-attr-64-fail.ll (removed)
@@ -1,11 +0,0 @@
-; RUN: llc -mcpu=mips64r6 -march=mipsel -relocation-model=static -o - %s | FileCheck %s
-; XFAIL: *
-
-define void @isr_sw0() #0 {
- call void bitcast (void (...)* @write to void ()*)()
-}
-
-declare void @write(...)
-
-attributes #0 = { "interrupt"="sw0" }
-
Added: llvm/trunk/test/CodeGen/Mips/interrupt-attr-args-error.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/interrupt-attr-args-error.ll?rev=251295&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/interrupt-attr-args-error.ll (added)
+++ llvm/trunk/test/CodeGen/Mips/interrupt-attr-args-error.ll Mon Oct 26 09:24:30 2015
@@ -0,0 +1,9 @@
+; RUN: not llc -mcpu=mips32r2 -march=mipsel -relocation-model=static < %s 2> %t
+; RUN: FileCheck %s < %t
+
+; CHECK: LLVM ERROR: Functions with the interrupt attribute cannot have arguments!
+define i32 @isr_sw0(i8 signext %n) #0 {
+ ret i32 0
+}
+
+attributes #0 = { "interrupt"="sw0" }
Removed: llvm/trunk/test/CodeGen/Mips/interrupt-attr-args-fail.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/interrupt-attr-args-fail.ll?rev=251294&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/interrupt-attr-args-fail.ll (original)
+++ llvm/trunk/test/CodeGen/Mips/interrupt-attr-args-fail.ll (removed)
@@ -1,11 +0,0 @@
-; RUN: llc -mcpu=mips32r2 -march=mipsel -relocation-model=static -o - %s | FileCheck %s
-; XFAIL: *
-
-define void @isr_sw0(i8 signext %n) #0 {
- call void bitcast (void (...)* @write to void ()*)()
-}
-
-declare void @write(...)
-
-attributes #0 = { "interrupt"="sw0" }
-
Added: llvm/trunk/test/CodeGen/Mips/interrupt-attr-error.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/interrupt-attr-error.ll?rev=251295&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/interrupt-attr-error.ll (added)
+++ llvm/trunk/test/CodeGen/Mips/interrupt-attr-error.ll Mon Oct 26 09:24:30 2015
@@ -0,0 +1,9 @@
+; RUN: not llc -mcpu=mips32 -march=mipsel -relocation-model=static < %s 2>%t
+; RUN: FileCheck %s < %t
+
+; CHECK: LLVM ERROR: "interrupt" attribute is not supported on pre-MIPS32R2 or MIPS16 targets.
+define i32 @isr_sw0() #0 {
+ ret i32 0
+}
+
+attributes #0 = { "interrupt"="sw0" }
Removed: llvm/trunk/test/CodeGen/Mips/interrupt-attr-fail.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/interrupt-attr-fail.ll?rev=251294&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/interrupt-attr-fail.ll (original)
+++ llvm/trunk/test/CodeGen/Mips/interrupt-attr-fail.ll (removed)
@@ -1,11 +0,0 @@
-; RUN: llc -mcpu=mips32 -march=mipsel -relocation-model=static -o - %s | FileCheck %s
-; XFAIL: *
-
-define void @isr_sw0() #0 {
- call void bitcast (void (...)* @write to void ()*)()
-}
-
-declare void @write(...)
-
-attributes #0 = { "interrupt"="sw0" }
-
More information about the llvm-commits
mailing list