1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -run-pass=legalizer %s -o - | FileCheck %s
5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
6 target triple = "aarch64--"
7 define void @test_constant() {
11 define void @test_fconstant() {
16 define i8* @test_global() { ret i8* undef }
31 ; CHECK-LABEL: name: test_constant
32 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
33 ; CHECK: $w0 = COPY [[C]](s32)
34 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
35 ; CHECK: $w0 = COPY [[C1]](s32)
36 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
37 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
38 ; CHECK: $w0 = COPY [[COPY]](s32)
39 ; CHECK: $w0 = COPY [[C2]](s32)
40 ; CHECK: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
41 ; CHECK: $x0 = COPY [[C3]](s64)
42 ; CHECK: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
43 ; CHECK: $x0 = COPY [[C4]](s64)
44 %0(s1) = G_CONSTANT i1 0
45 %6:_(s32) = G_ANYEXT %0
47 %1(s8) = G_CONSTANT i8 42
48 %7:_(s32) = G_ANYEXT %1
50 %2(s16) = G_CONSTANT i16 65535
51 %8:_(s32) = G_ANYEXT %2
53 %3(s32) = G_CONSTANT i32 -1
55 %4(s64) = G_CONSTANT i64 1
57 %5(s64) = G_CONSTANT i64 0
70 ; CHECK-LABEL: name: test_fconstant
71 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 1.000000e+00
72 ; CHECK: $w0 = COPY [[C]](s32)
73 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_FCONSTANT double 2.000000e+00
74 ; CHECK: $x0 = COPY [[C1]](s64)
75 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_FCONSTANT float 0.000000e+00
76 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[C2]](s32)
77 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC]](s16)
78 ; CHECK: $w0 = COPY [[ANYEXT]](s32)
79 %0(s32) = G_FCONSTANT float 1.0
81 %1(s64) = G_FCONSTANT double 2.0
83 %2(s16) = G_FCONSTANT half 0.0
84 %3:_(s32) = G_ANYEXT %2
95 ; CHECK-LABEL: name: test_global
96 ; CHECK: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @var
97 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[GV]](p0)
98 ; CHECK: $x0 = COPY [[PTRTOINT]](s64)
99 %0(p0) = G_GLOBAL_VALUE @var
100 %1:_(s64) = G_PTRTOINT %0