• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -O0 -run-pass=legalizer %s -o - | FileCheck %s
3
4--- |
5  target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
6  target triple = "aarch64--"
7  define void @test_constant() {
8  entry:
9    ret void
10  }
11  define void @test_fconstant() {
12  entry:
13    ret void
14  }
15...
16
17---
18name:            test_constant
19registers:
20  - { id: 0, class: _ }
21  - { id: 1, class: _ }
22  - { id: 2, class: _ }
23  - { id: 3, class: _ }
24  - { id: 4, class: _ }
25  - { id: 5, class: _ }
26body: |
27  bb.0.entry:
28
29    ; CHECK-LABEL: name: test_constant
30    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
31    ; CHECK: $w0 = COPY [[C]](s32)
32    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
33    ; CHECK: $w0 = COPY [[C1]](s32)
34    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
35    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
36    ; CHECK: $w0 = COPY [[COPY]](s32)
37    ; CHECK: $w0 = COPY [[C2]](s32)
38    ; CHECK: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
39    ; CHECK: $x0 = COPY [[C3]](s64)
40    ; CHECK: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
41    ; CHECK: $x0 = COPY [[C4]](s64)
42    %0(s1) = G_CONSTANT i1 0
43    %6:_(s32) = G_ANYEXT %0
44    $w0 = COPY %6
45    %1(s8) = G_CONSTANT i8 42
46    %7:_(s32) = G_ANYEXT %1
47    $w0 = COPY %7
48    %2(s16) = G_CONSTANT i16 65535
49    %8:_(s32) = G_ANYEXT %2
50    $w0 = COPY %8
51    %3(s32) = G_CONSTANT i32 -1
52    $w0 = COPY %3
53    %4(s64) = G_CONSTANT i64 1
54    $x0 = COPY %4
55    %5(s64) = G_CONSTANT i64 0
56    $x0 = COPY %5
57...
58
59---
60name:            test_fconstant
61registers:
62  - { id: 0, class: _ }
63  - { id: 1, class: _ }
64  - { id: 2, class: _ }
65body: |
66  bb.0.entry:
67
68    ; CHECK-LABEL: name: test_fconstant
69    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 1.000000e+00
70    ; CHECK: $w0 = COPY [[C]](s32)
71    ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_FCONSTANT double 2.000000e+00
72    ; CHECK: $x0 = COPY [[C1]](s64)
73    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_FCONSTANT float 0.000000e+00
74    ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[C2]](s32)
75    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC]](s16)
76    ; CHECK: $w0 = COPY [[ANYEXT]](s32)
77    %0(s32) = G_FCONSTANT float 1.0
78    $w0 = COPY %0
79    %1(s64) = G_FCONSTANT double 2.0
80    $x0 = COPY %1
81    %2(s16) = G_FCONSTANT half 0.0
82    %3:_(s32) = G_ANYEXT %2
83    $w0 = COPY %3
84...
85