1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/Transforms/GlobalOpt/large-int-crash.ll
Sanjay Patel ad0cf79cfe [GlobalOpt] prevent crashing on large integer types (PR42932)
This is a minimal fix (copy the predicate for the assert) to
prevent the crashing seen in:
https://bugs.llvm.org/show_bug.cgi?id=42932
...when converting a constant integer of arbitrary width to uint64_t.

Differential Revision: https://reviews.llvm.org/D65970

llvm-svn: 368437
2019-08-09 12:43:25 +00:00

24 lines
581 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -globalopt -S | FileCheck %s
@X = internal global i128 0
define void @foo() {
; CHECK-LABEL: @foo(
; CHECK-NEXT: [[T0_B:%.*]] = load i1, i1* @X
; CHECK-NEXT: [[T0:%.*]] = select i1 [[T0_B]], i128 18446744073709551616, i128 0
; CHECK-NEXT: ret void
;
%t0 = load i128, i128* @X, align 8
ret void
}
define void @store() {
; CHECK-LABEL: @store(
; CHECK-NEXT: store i1 true, i1* @X
; CHECK-NEXT: ret void
;
store i128 18446744073709551616, i128* @X, align 8
ret void
}