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() {
19 %0 = load i32, i32* @x
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() {
32 %0 = load i32, i32* @x
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() {
53 %0 = load i32, i32* @x
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() {
76 %0 = load i16, i16* @a
77 %1 = load i16, i16* @b
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}}
112 define i32 @use_i8() {
114 %0 = call i8 @unsigned_i8();
115 %1 = zext i8 %0 to i32
118 ; The high 24 bits of %eax from a function returning i8 are undefined.
119 ; CHECK-LABEL: use_i8:
122 ; CHECK-NEXT: {{pop|add}}
126 define i32 @use_i16() {
128 %0 = call i16 @unsigned_i16();
129 %1 = zext i16 %0 to i32
132 ; The high 16 bits of %eax from a function returning i16 are undefined.
133 ; CHECK-LABEL: use_i16:
136 ; CHECK-NEXT: {{pop|add}}