Skip to content

Commit c0476c3

Browse files
committed
comment better test
Created using spr 1.3.5-bogner
1 parent cc48332 commit c0476c3

File tree

5 files changed

+13
-19
lines changed

5 files changed

+13
-19
lines changed

llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,7 @@ class MipsOperand : public MCParsedAsmOperand {
13161316
int64_t Res;
13171317
if (getImm()->evaluateAsAbsolute(Res))
13181318
return isInt<Bits>(Res);
1319+
// Allow conservatively if not a parse-time constant.
13191320
return true;
13201321
}
13211322

@@ -1325,6 +1326,7 @@ class MipsOperand : public MCParsedAsmOperand {
13251326
int64_t Res;
13261327
if (getImm()->evaluateAsAbsolute(Res))
13271328
return isUInt<Bits>(Res);
1329+
// Allow conservatively if not a parse-time constant.
13281330
return true;
13291331
}
13301332

llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ unsigned MipsMCCodeEmitter::getImmOpValue(const MCInst &MI, const MCOperand &MO,
735735
unsigned MIFrm = MipsII::getFormat(MCII.get(MI.getOpcode()).TSFlags);
736736
if (!isa<MCTargetExpr>(Expr) && MIFrm == MipsII::FrmI) {
737737
Fixups.push_back(MCFixup::create(
738-
0, Expr, MCFixupKind(Mips::fixup_Mips_AnyImm16), MI.getLoc()));
738+
0, Expr, MCFixupKind(Mips::fixup_Mips_AnyImm16), Expr->getLoc()));
739739
return 0;
740740
}
741741
return getExprOpValue(Expr, Fixups, STI);

llvm/test/MC/Mips/fixup-expr.s

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@ addiu $4, $5, .L0-.L1
1616
addiu $4, $5, .L2-.L1
1717
addiu $4, $5, .L2-.L0+0
1818

19+
# CHECK: andi $4, $5, 0xffff
20+
# CHECK: slti $4, $5, -0x1
21+
andi $4, $5, v65535 # uimm16
22+
slti $4, $5, v65535 # simm16
23+
1924
.ifdef ERR
20-
# ERR: :[[#@LINE+1]]:1: error: fixup value out of range [-32768, 65535]
25+
# ERR: :[[#@LINE+1]]:15: error: fixup value out of range [-32768, 65535]
2126
addiu $4, $5, v_32769
22-
# ERR: :[[#@LINE+1]]:1: error: fixup value out of range [-32768, 65535]
27+
# ERR: :[[#@LINE+1]]:21: error: fixup value out of range [-32768, 65535]
2328
addiu $4, $5, v65535+1
2429

25-
# ERR: [[#@LINE+1]]:1: error: fixup value out of range [-32768, 65535]
30+
# ERR: [[#@LINE+1]]:18: error: fixup value out of range [-32768, 65535]
2631
addiu $4, $5, .L2-.L0+1
2732
.endif
2833

llvm/test/MC/Mips/fixup-out-of-range.s

Lines changed: 0 additions & 13 deletions
This file was deleted.

llvm/test/MC/Mips/imm-operand-err.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# RUN: not llvm-mc -filetype=obj -triple=mips -o /dev/null %s 2>&1 | FileCheck %s --implicit-check-not=error:
33
# RUN: not llvm-mc -filetype=obj -triple=mips64 -o /dev/null %s 2>&1 | FileCheck %s --implicit-check-not=error:
44

5-
# CHECK: [[#@LINE+1]]:3: error: unsupported relocation type
5+
# CHECK: [[#@LINE+1]]:16: error: unsupported relocation type
66
ori $4, $4, start
77
ori $4, $4, (start - .)
88

9-
# CHECK: [[#@LINE+1]]:3: error: unsupported relocation type
9+
# CHECK: [[#@LINE+1]]:18: error: unsupported relocation type
1010
addiu $4, $4, start
1111
addiu $4, $4, (start - .)
1212

0 commit comments

Comments
 (0)