A while back, a diagnostic was added to object file generation codepath for when an MCExpr overflows its size. So for assembly something like
.long a - b + 5000000000
(except produced from CodeGen because the assembler would reject that). Unfortunately I don't think it's really valid when looked at from the IR level. We've seen an obfuscator (naturally) produce code looking something like this:
@other = global i32 42 @var = global i32 sub(i32 646102975, i32 add (i32 trunc(i64 sub(i64 ptrtoint(i32* @var to i64), i64 ptrtoint(i32* @other to i64)) to i32), i32 3432360802))
where the resulting SymB - SymA + Val has a Val outside the 32-bit range (because MCExprs are always evaluated at 64-bits precision). But LLVM IR is 2s-complement unless you add no-wrap flags, so I think that calculation is legitimate and has to be allowed.