1 ; RUN: llc < %s -mtriple=i686-unknown-linux-gnu -fixup-byte-word-insts=0 | \
2 ; RUN: FileCheck -check-prefix=CHECK -check-prefix=BWOFF %s
3 ; RUN: llc < %s -mtriple=i686-unknown-linux-gnu -fixup-byte-word-insts=1 | \
4 ; RUN: FileCheck -check-prefix=CHECK -check-prefix=BWON %s
5 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -fixup-byte-word-insts=0 | \
6 ; RUN: FileCheck -check-prefix=CHECK -check-prefix=BWOFF %s
7 ; RUN: llc < %s -mtriple=i686-unknown-linux-gnu -fixup-byte-word-insts=1 | \
8 ; RUN: FileCheck -check-prefix=CHECK -check-prefix=BWON %s
9 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -fixup-byte-word-insts=0 | \
10 ; RUN: FileCheck -check-prefix=DARWIN -check-prefix=DARWIN-BWOFF %s
11 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -fixup-byte-word-insts=1 | \
12 ; RUN: FileCheck -check-prefix=DARWIN -check-prefix=DARWIN-BWON %s
15 @x = common global i32 0, align 4
17 define zeroext i1 @unsigned_i1() {
20 %cmp = icmp eq i32 %0, 42
23 ; Unsigned i1 return values are not extended.
24 ; CHECK-LABEL: unsigned_i1:
30 define zeroext i8 @unsigned_i8() {
33 %cmp = icmp eq i32 %0, 42
34 %retval = zext i1 %cmp to i8
37 ; Unsigned i8 return values are not extended.
38 ; CHECK-LABEL: unsigned_i8:
43 ; Except on Darwin, for legacy reasons.
44 ; DARWIN-LABEL: unsigned_i8:
51 define signext i8 @signed_i8() {
54 %cmp = icmp eq i32 %0, 42
55 %retval = zext i1 %cmp to i8
58 ; Signed i8 return values are not extended.
59 ; CHECK-LABEL: signed_i8:
64 ; Except on Darwin, for legacy reasons.
65 ; DARWIN-LABEL: signed_i8:
72 @a = common global i16 0
73 @b = common global i16 0
74 define zeroext i16 @unsigned_i16() {
81 ; i16 return values are not extended.
82 ; CHECK-LABEL: unsigned_i16:
88 ; Except on Darwin, for legacy reasons.
89 ; DARWIN-LABEL: unsigned_i16:
98 define i32 @use_i1() {
100 %0 = call i1 @unsigned_i1();
101 %1 = zext i1 %0 to i32
104 ; The high 24 bits of %eax from a function returning i1 are undefined.
105 ; CHECK-LABEL: use_i1:
108 ; CHECK-NEXT: {{pop|add}}
109 ; CHECK-NEXT: .cfi_def_cfa_offset {{4|8}}
113 define i32 @use_i8() {
115 %0 = call i8 @unsigned_i8();
116 %1 = zext i8 %0 to i32
119 ; The high 24 bits of %eax from a function returning i8 are undefined.
120 ; CHECK-LABEL: use_i8:
123 ; CHECK-NEXT: {{pop|add}}
124 ; CHECK-NEXT: .cfi_def_cfa_offset {{4|8}}
128 define i32 @use_i16() {
130 %0 = call i16 @unsigned_i16();
131 %1 = zext i16 %0 to i32
134 ; The high 16 bits of %eax from a function returning i16 are undefined.
135 ; CHECK-LABEL: use_i16:
138 ; CHECK-NEXT: {{pop|add}}
139 ; CHECK-NEXT: .cfi_def_cfa_offset {{4|8}}