1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=i386-linux-gnu   -mattr=+sse2 -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32
3# RUN: llc -mtriple=x86_64-linux-gnu              -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
4
5--- |
6  define void @test_constant() { ret void }
7  define void @test_fconstant() { ret void }
8
9...
10---
11name:            test_constant
12registers:
13  - { id: 0, class: _ }
14  - { id: 1, class: _ }
15  - { id: 2, class: _ }
16  - { id: 3, class: _ }
17  - { id: 4, class: _ }
18body:             |
19  bb.1 (%ir-block.0):
20    ; X32-LABEL: name: test_constant
21    ; X32: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 -1
22    ; X32: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[C]](s8)
23    ; X32: $eax = COPY [[ANYEXT]](s32)
24    ; X32: [[C1:%[0-9]+]]:_(s8) = G_CONSTANT i8 8
25    ; X32: $al = COPY [[C1]](s8)
26    ; X32: [[C2:%[0-9]+]]:_(s16) = G_CONSTANT i16 16
27    ; X32: $ax = COPY [[C2]](s16)
28    ; X32: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
29    ; X32: $eax = COPY [[C3]](s32)
30    ; X32: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 64
31    ; X32: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
32    ; X32: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[C4]](s32), [[C5]](s32)
33    ; X32: $rax = COPY [[MV]](s64)
34    ; X32: RET 0
35    ; X64-LABEL: name: test_constant
36    ; X64: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 -1
37    ; X64: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[C]](s8)
38    ; X64: $eax = COPY [[ANYEXT]](s32)
39    ; X64: [[C1:%[0-9]+]]:_(s8) = G_CONSTANT i8 8
40    ; X64: $al = COPY [[C1]](s8)
41    ; X64: [[C2:%[0-9]+]]:_(s16) = G_CONSTANT i16 16
42    ; X64: $ax = COPY [[C2]](s16)
43    ; X64: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
44    ; X64: $eax = COPY [[C3]](s32)
45    ; X64: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 64
46    ; X64: $rax = COPY [[C4]](s64)
47    ; X64: RET 0
48    %0(s1) = G_CONSTANT i1 1
49    %5:_(s32) = G_ANYEXT %0
50    $eax = COPY %5
51
52    %1(s8) = G_CONSTANT i8 8
53    $al = COPY %1
54    %2(s16) = G_CONSTANT i16 16
55    $ax = COPY %2
56
57    %3(s32) = G_CONSTANT i32 32
58    $eax = COPY %3
59
60
61    %4(s64) = G_CONSTANT i64 64
62    $rax = COPY %4
63
64    RET 0
65...
66---
67name:            test_fconstant
68registers:
69  - { id: 0, class: _ }
70  - { id: 1, class: _ }
71body: |
72  bb.0:
73
74    ; X32-LABEL: name: test_fconstant
75    ; X32: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 1.000000e+00
76    ; X32: $eax = COPY [[C]](s32)
77    ; X32: [[C1:%[0-9]+]]:_(s64) = G_FCONSTANT double 2.000000e+00
78    ; X32: $rax = COPY [[C1]](s64)
79    ; X64-LABEL: name: test_fconstant
80    ; X64: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 1.000000e+00
81    ; X64: $eax = COPY [[C]](s32)
82    ; X64: [[C1:%[0-9]+]]:_(s64) = G_FCONSTANT double 2.000000e+00
83    ; X64: $rax = COPY [[C1]](s64)
84    %0(s32) = G_FCONSTANT float 1.0
85    $eax = COPY %0
86    %1(s64) = G_FCONSTANT double 2.0
87    $rax = COPY %1
88...
89
90