1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple aarch64 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s
9 ; CHECK-LABEL: name: test_constant
10 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
11 ; CHECK: $w0 = COPY [[C]](s32)
12 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
13 ; CHECK: $w0 = COPY [[C1]](s32)
14 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
15 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
16 ; CHECK: $w0 = COPY [[COPY]](s32)
17 ; CHECK: $w0 = COPY [[C2]](s32)
18 ; CHECK: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
19 ; CHECK: $x0 = COPY [[C3]](s64)
20 ; CHECK: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
21 ; CHECK: $x0 = COPY [[C4]](s64)
22 %0:_(s1) = G_CONSTANT i1 0
23 %6:_(s32) = G_ANYEXT %0
25 %1:_(s8) = G_CONSTANT i8 42
26 %7:_(s32) = G_ANYEXT %1
28 %2:_(s16) = G_CONSTANT i16 65535
29 %8:_(s32) = G_ANYEXT %2
31 %3:_(s32) = G_CONSTANT i32 -1
33 %4:_(s64) = G_CONSTANT i64 1
35 %5:_(s64) = G_CONSTANT i64 0
44 ; CHECK-LABEL: name: test_fconstant
45 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 1.000000e+00
46 ; CHECK: $w0 = COPY [[C]](s32)
47 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_FCONSTANT double 2.000000e+00
48 ; CHECK: $x0 = COPY [[C1]](s64)
49 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_FCONSTANT float 0.000000e+00
50 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[C2]](s32)
51 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC]](s16)
52 ; CHECK: $w0 = COPY [[ANYEXT]](s32)
53 %0:_(s32) = G_FCONSTANT float 1.0
55 %1:_(s64) = G_FCONSTANT double 2.0
57 %2:_(s16) = G_FCONSTANT half 0.0
58 %3:_(s32) = G_ANYEXT %2
68 ; CHECK-LABEL: name: s792
69 ; CHECK: %trunc:_(s32) = G_CONSTANT i32 0
70 ; CHECK: $w0 = COPY %trunc(s32)
71 ; CHECK: RET_ReallyLR implicit $w0
72 %cst:_(s792) = G_CONSTANT i792 0
73 %trunc:_(s32) = G_TRUNC %cst(s792)
74 $w0 = COPY %trunc(s32)
75 RET_ReallyLR implicit $w0