• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=i386-apple-darwin10.0 | FileCheck %s --check-prefix=CHECK-X86
3; RUN: llc < %s -mtriple=x86_64-grtev4-linux-gnu | FileCheck %s --check-prefix=CHECK-X64
4
5@g_14 = global i8 -6, align 1                     ; <i8*> [#uses=1]
6
7declare i32 @func_16(i8 signext %p_19, i32 %p_20) nounwind
8
9define i32 @func_35(i64 %p_38) nounwind ssp {
10; CHECK-X86-LABEL: func_35:
11; CHECK-X86:       ## %bb.0: ## %entry
12; CHECK-X86-NEXT:    subl $12, %esp
13; CHECK-X86-NEXT:    movsbl _g_14, %eax
14; CHECK-X86-NEXT:    xorl %ecx, %ecx
15; CHECK-X86-NEXT:    testl $255, %eax
16; CHECK-X86-NEXT:    setg %cl
17; CHECK-X86-NEXT:    subl $8, %esp
18; CHECK-X86-NEXT:    pushl %ecx
19; CHECK-X86-NEXT:    pushl %eax
20; CHECK-X86-NEXT:    calll _func_16
21; CHECK-X86-NEXT:    addl $16, %esp
22; CHECK-X86-NEXT:    movl $1, %eax
23; CHECK-X86-NEXT:    addl $12, %esp
24; CHECK-X86-NEXT:    retl
25;
26; CHECK-X64-LABEL: func_35:
27; CHECK-X64:       # %bb.0: # %entry
28; CHECK-X64-NEXT:    pushq %rax
29; CHECK-X64-NEXT:    movsbl {{.*}}(%rip), %edi
30; CHECK-X64-NEXT:    xorl %esi, %esi
31; CHECK-X64-NEXT:    testl $255, %edi
32; CHECK-X64-NEXT:    setg %sil
33; CHECK-X64-NEXT:    callq func_16
34; CHECK-X64-NEXT:    movl $1, %eax
35; CHECK-X64-NEXT:    popq %rcx
36; CHECK-X64-NEXT:    retq
37entry:
38  %tmp = load i8, i8* @g_14                           ; <i8> [#uses=2]
39  %conv = zext i8 %tmp to i32                     ; <i32> [#uses=1]
40  %cmp = icmp sle i32 1, %conv                    ; <i1> [#uses=1]
41  %conv2 = zext i1 %cmp to i32                    ; <i32> [#uses=1]
42  %call = call i32 @func_16(i8 signext %tmp, i32 %conv2) ssp ; <i32> [#uses=1]
43  ret i32 1
44}
45
46define void @fail(i16 %a, <2 x i8> %b) {
47; CHECK-X86-LABEL: fail:
48; CHECK-X86:       ## %bb.0:
49; CHECK-X86-NEXT:    subl $12, %esp
50; CHECK-X86-NEXT:    .cfi_def_cfa_offset 16
51; CHECK-X86-NEXT:    movzwl {{[0-9]+}}(%esp), %ecx
52; CHECK-X86-NEXT:    cmpb $123, {{[0-9]+}}(%esp)
53; CHECK-X86-NEXT:    sete %al
54; CHECK-X86-NEXT:    testl $263, %ecx ## imm = 0x107
55; CHECK-X86-NEXT:    je LBB1_2
56; CHECK-X86-NEXT:  ## %bb.1:
57; CHECK-X86-NEXT:    testb %al, %al
58; CHECK-X86-NEXT:    jne LBB1_2
59; CHECK-X86-NEXT:  ## %bb.3: ## %no
60; CHECK-X86-NEXT:    calll _bar
61; CHECK-X86-NEXT:    addl $12, %esp
62; CHECK-X86-NEXT:    retl
63; CHECK-X86-NEXT:  LBB1_2: ## %yes
64; CHECK-X86-NEXT:    addl $12, %esp
65; CHECK-X86-NEXT:    retl
66;
67; CHECK-X64-LABEL: fail:
68; CHECK-X64:       # %bb.0:
69; CHECK-X64-NEXT:    pushq %rax
70; CHECK-X64-NEXT:    .cfi_def_cfa_offset 16
71; CHECK-X64-NEXT:    testw $263, %di # imm = 0x107
72; CHECK-X64-NEXT:    je .LBB1_2
73; CHECK-X64-NEXT:  # %bb.1:
74; CHECK-X64-NEXT:    pand {{.*}}(%rip), %xmm0
75; CHECK-X64-NEXT:    pcmpeqd {{.*}}(%rip), %xmm0
76; CHECK-X64-NEXT:    pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
77; CHECK-X64-NEXT:    pand %xmm0, %xmm1
78; CHECK-X64-NEXT:    pextrw $4, %xmm1, %eax
79; CHECK-X64-NEXT:    testb $1, %al
80; CHECK-X64-NEXT:    jne .LBB1_2
81; CHECK-X64-NEXT:  # %bb.3: # %no
82; CHECK-X64-NEXT:    callq bar
83; CHECK-X64-NEXT:    popq %rax
84; CHECK-X64-NEXT:    .cfi_def_cfa_offset 8
85; CHECK-X64-NEXT:    retq
86; CHECK-X64-NEXT:  .LBB1_2: # %yes
87; CHECK-X64-NEXT:    .cfi_def_cfa_offset 16
88; CHECK-X64-NEXT:    popq %rax
89; CHECK-X64-NEXT:    .cfi_def_cfa_offset 8
90; CHECK-X64-NEXT:    retq
91  %1 = icmp eq <2 x i8> %b, <i8 40, i8 123>
92  %2 = extractelement <2 x i1> %1, i32 1
93  %3 = and i16 %a, 263
94  %4 = icmp eq i16 %3, 0
95  %merge = or i1 %4, %2
96  br i1 %merge, label %yes, label %no
97
98yes:                                              ; preds = %0
99  ret void
100
101no:                                               ; preds = %0
102  call void @bar()
103  ret void
104}
105
106declare void @bar()
107