mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Fix handling of the 'n' asm constraint with invalid operands.
It had accidently accepted a symbol+offset value (and emitted incorrect code for it, keeping only the offset part) instead of properly reporting the constraint as invalid. Differential Revision: http://reviews.llvm.org/D11039 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242040 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2218,8 +2218,8 @@ void TargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
|||||||
Ops.push_back(DAG.getTargetGlobalAddress(GA->getGlobal(),
|
Ops.push_back(DAG.getTargetGlobalAddress(GA->getGlobal(),
|
||||||
C ? SDLoc(C) : SDLoc(),
|
C ? SDLoc(C) : SDLoc(),
|
||||||
Op.getValueType(), Offs));
|
Op.getValueType(), Offs));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (C) { // just C, no GV.
|
if (C) { // just C, no GV.
|
||||||
// Simple constants are not allowed for 's'.
|
// Simple constants are not allowed for 's'.
|
||||||
@@ -2229,8 +2229,8 @@ void TargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
|||||||
// ScheduleDAGSDNodes::EmitNode, which is very generic.
|
// ScheduleDAGSDNodes::EmitNode, which is very generic.
|
||||||
Ops.push_back(DAG.getTargetConstant(C->getAPIntValue().getSExtValue(),
|
Ops.push_back(DAG.getTargetConstant(C->getAPIntValue().getSExtValue(),
|
||||||
SDLoc(C), MVT::i64));
|
SDLoc(C), MVT::i64));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
10
test/CodeGen/X86/inline-asm-bad-constraint-n.ll
Normal file
10
test/CodeGen/X86/inline-asm-bad-constraint-n.ll
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
; RUN: not llc -march=x86 -no-integrated-as < %s 2>&1 | FileCheck %s
|
||||||
|
|
||||||
|
@x = global i32 0, align 4
|
||||||
|
|
||||||
|
;CHECK: error: invalid operand for inline asm constraint 'n'
|
||||||
|
define void @foo() {
|
||||||
|
%a = getelementptr i32, i32* @x, i32 1
|
||||||
|
call void asm sideeffect "foo $0", "n"(i32* %a) nounwind
|
||||||
|
ret void
|
||||||
|
}
|
Reference in New Issue
Block a user