• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -show-mc-encoding < %s | FileCheck %s
2
3; Test that the direct object emission selects the and variant with 8 bit
4; immediate.
5; We used to get this wrong when using direct object emission, but not when
6; reading assembly.
7
8
9target triple = "x86_64-pc-linux"
10
11define void @f1() {
12; CHECK-LABEL: f1:
13; CHECK: andq    $-32, %rsp              # encoding: [0x48,0x83,0xe4,0xe0]
14  %foo = alloca i8, align 32
15  ret void
16}
17
18define void @f2(i1 *%x, i16 *%y) {
19; CHECK-LABEL: f2:
20; CHECK: andl	$1, %eax                # encoding: [0x83,0xe0,0x01]
21  %a = load i1, i1* %x
22  %b = zext i1 %a to i16
23  store i16 %b, i16* %y
24  ret void
25}
26
27define i32 @f3(i1 *%x) {
28; CHECK-LABEL: f3:
29; CHECK: andl	$1, %eax                # encoding: [0x83,0xe0,0x01]
30  %a = load i1, i1* %x
31  %b = zext i1 %a to i32
32  ret i32 %b
33}
34
35define i64 @f4(i1 *%x) {
36; CHECK-LABEL: f4:
37; CHECK: andl	$1, %eax                # encoding: [0x83,0xe0,0x01]
38  %a = load i1, i1* %x
39  %b = zext i1 %a to i64
40  ret i64 %b
41}
42