brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · d7085a5 Raw
83 lines · plain
1; RUN: not llc < %s -mtriple=i686 -filetype=null -verify-machineinstrs 2>&1 | FileCheck %s -check-prefix=ERR-i6862; RUN: llc < %s -mtriple=x86_64 -verify-machineinstrs | FileCheck %s -check-prefix=x86_643 4; Regression test for #121932, #113856, #106352, #69365, #25051 which are caused by5; an incorrectly written assertion for 64-bit offsets when compiling for 32-bit X86.6 7define i32 @main() #0 {8; ERR-i686: error: <unknown>:0:0: 64-bit offset calculated but target is 32-bit9;10; x86_64-LABEL: main:11; x86_64:       # %bb.0: # %entry12; x86_64-NEXT:    movl $4294967192, %eax # imm = 0xFFFFFF9813; x86_64-NEXT:    subq %rax, %rsp14; x86_64-NEXT:    .cfi_def_cfa_offset 429496720015; x86_64-NEXT:    movabsq $3221225318, %rax # imm = 0xBFFFFF6616; x86_64-NEXT:    movb $32, (%rsp,%rax)17; x86_64-NEXT:    movb $33, 2147483494(%rsp)18; x86_64-NEXT:    movb $34, 1073741670(%rsp)19; x86_64-NEXT:    movb $35, -154(%rsp)20; x86_64-NEXT:    xorl %eax, %eax21; x86_64-NEXT:    movl $4294967192, %ecx # imm = 0xFFFFFF9822; x86_64-NEXT:    addq %rcx, %rsp23; x86_64-NEXT:    .cfi_def_cfa_offset 824; x86_64-NEXT:    retq25entry:26  %a = alloca [1073741824 x i8], align 1627  %b = alloca [1073741824 x i8], align 1628  %c = alloca [1073741824 x i8], align 1629  %d = alloca [1073741824 x i8], align 1630 31  %arrayida = getelementptr inbounds [1073741824 x i8], ptr %a, i64 0, i64 -4232  %arrayidb = getelementptr inbounds [1073741824 x i8], ptr %b, i64 0, i64 -4233  %arrayidc = getelementptr inbounds [1073741824 x i8], ptr %c, i64 0, i64 -4234  %arrayidd = getelementptr inbounds [1073741824 x i8], ptr %d, i64 0, i64 -4235 36  store i8 32, ptr %arrayida, align 237  store i8 33, ptr %arrayidb, align 238  store i8 34, ptr %arrayidc, align 239  store i8 35, ptr %arrayidd, align 240 41  ret i32 042}43 44; Same test as above but for an anonymous function.45define i32 @0() #0 {46; ERR-i686: error: <unknown>:0:0: 64-bit offset calculated but target is 32-bit47;48; x86_64-LABEL: __unnamed_1:49; x86_64:       # %bb.0: # %entry50; x86_64-NEXT:    movl $4294967192, %eax # imm = 0xFFFFFF9851; x86_64-NEXT:    subq %rax, %rsp52; x86_64-NEXT:    .cfi_def_cfa_offset 429496720053; x86_64-NEXT:    movabsq $3221225318, %rax # imm = 0xBFFFFF6654; x86_64-NEXT:    movb $32, (%rsp,%rax)55; x86_64-NEXT:    movb $33, 2147483494(%rsp)56; x86_64-NEXT:    movb $34, 1073741670(%rsp)57; x86_64-NEXT:    movb $35, -154(%rsp)58; x86_64-NEXT:    xorl %eax, %eax59; x86_64-NEXT:    movl $4294967192, %ecx # imm = 0xFFFFFF9860; x86_64-NEXT:    addq %rcx, %rsp61; x86_64-NEXT:    .cfi_def_cfa_offset 862; x86_64-NEXT:    retq63entry:64  %a = alloca [1073741824 x i8], align 1665  %b = alloca [1073741824 x i8], align 1666  %c = alloca [1073741824 x i8], align 1667  %d = alloca [1073741824 x i8], align 1668 69  %arrayida = getelementptr inbounds [1073741824 x i8], ptr %a, i64 0, i64 -4270  %arrayidb = getelementptr inbounds [1073741824 x i8], ptr %b, i64 0, i64 -4271  %arrayidc = getelementptr inbounds [1073741824 x i8], ptr %c, i64 0, i64 -4272  %arrayidd = getelementptr inbounds [1073741824 x i8], ptr %d, i64 0, i64 -4273 74  store i8 32, ptr %arrayida, align 275  store i8 33, ptr %arrayidb, align 276  store i8 34, ptr %arrayidc, align 277  store i8 35, ptr %arrayidd, align 278 79  ret i32 080}81 82attributes #0 = { optnone noinline }83