103 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mcpu=generic -mtriple=i686-- | FileCheck %s3 %struct._obstack_chunk = type { ptr, ptr, [4 x i8] }4 %struct.obstack = type { i32, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, ptr, i8 }5@stmt_obstack = external dso_local global %struct.obstack ; <ptr> [#uses=1]6 7; This should just not crash.8define void @test1() nounwind {9; CHECK-LABEL: test1:10; CHECK: # %bb.0: # %entry11; CHECK-NEXT: testb $1, stmt_obstack+4012; CHECK-NEXT: jne .LBB0_113; CHECK-NEXT: # %bb.2: # %cond_false30.i14; CHECK-NEXT: pushl $015; CHECK-NEXT: calll 016; CHECK-NEXT: addl $4, %esp17; CHECK-NEXT: retl18; CHECK-NEXT: .LBB0_1: # %cond_true23.i19; CHECK-NEXT: retl20entry:21 br i1 true, label %cond_true, label %cond_next22 23cond_true: ; preds = %entry24 %new_size.0.i = select i1 false, i32 0, i32 0 ; <i32> [#uses=1]25 %tmp.i = load i32, ptr getelementptr (%struct.obstack, ptr @stmt_obstack, i32 0, i32 10) ; <i32> [#uses=1]26 %tmp.i.upgrd.1 = trunc i32 %tmp.i to i8 ; <i8> [#uses=1]27 %tmp21.i = and i8 %tmp.i.upgrd.1, 1 ; <i8> [#uses=1]28 %tmp22.i = icmp eq i8 %tmp21.i, 0 ; <i1> [#uses=1]29 br i1 %tmp22.i, label %cond_false30.i, label %cond_true23.i30 31cond_true23.i: ; preds = %cond_true32 ret void33 34cond_false30.i: ; preds = %cond_true35 %tmp35.i = tail call ptr null( i32 %new_size.0.i ) ; <ptr> [#uses=0]36 ret void37 38cond_next: ; preds = %entry39 ret void40}41 42 43 44define i32 @test2(ptr %P, ptr %Q) nounwind {45; CHECK-LABEL: test2:46; CHECK: # %bb.0:47; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx48; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax49; CHECK-NEXT: movzwl (%eax), %edx50; CHECK-NEXT: movzbl %dl, %eax51; CHECK-NEXT: movw %dx, (%ecx)52; CHECK-NEXT: retl53 %A = load i16, ptr %P, align 4 ; <i16> [#uses=11]54 %C = zext i16 %A to i32 ; <i32> [#uses=1]55 %D = and i32 %C, 255 ; <i32> [#uses=1]56 br label %L57L:58 59 store i16 %A, ptr %Q60 ret i32 %D61 62 63}64 65; rdar://1055409066; xor in exit block will be CSE'ed and load will be folded to xor in entry.67define i1 @test3(ptr %P, ptr %Q) nounwind {68; CHECK-LABEL: test3:69; CHECK: # %bb.0: # %entry70; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax71; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx72; CHECK-NEXT: movl (%eax), %eax73; CHECK-NEXT: xorl (%ecx), %eax74; CHECK-NEXT: testl $89947, %eax # imm = 0x15F5B75; CHECK-NEXT: je .LBB2_276; CHECK-NEXT: # %bb.1:77; CHECK-NEXT: xorl %eax, %eax78; CHECK-NEXT: # kill: def $al killed $al killed $eax79; CHECK-NEXT: retl80; CHECK-NEXT: .LBB2_2: # %exit81; CHECK-NEXT: testl $-838178173, %eax # imm = 0xCE0A6A8382; CHECK-NEXT: sete %al83; CHECK-NEXT: # kill: def $al killed $al killed $eax84; CHECK-NEXT: retl85entry:86 %0 = load i32, ptr %P, align 487 %1 = load i32, ptr %Q, align 488 %2 = xor i32 %0, %189 %3 = and i32 %2, 8994790 %4 = icmp eq i32 %3, 091 br i1 %4, label %exit, label %land.end92 93exit:94 %shr.i.i19 = xor i32 %1, %095 %5 = and i32 %shr.i.i19, 345678912396 %6 = icmp eq i32 %5, 097 br label %land.end98 99land.end:100 %7 = phi i1 [ %6, %exit ], [ false, %entry ]101 ret i1 %7102}103