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: [[COPY:%[0-9]+]]:_(s32) = COPY [[C]](s32)
34 ; CHECK: $w0 = COPY [[COPY]](s32)
35 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
36 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C1]](s32)
37 ; CHECK: $w0 = COPY [[COPY1]](s32)
38 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
39 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
40 ; CHECK: $w0 = COPY [[COPY2]](s32)
41 ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
42 ; CHECK: $w0 = COPY [[C3]](s32)
43 ; CHECK: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
44 ; CHECK: $x0 = COPY [[C4]](s64)
45 ; CHECK: [[C5:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
46 ; CHECK: $x0 = COPY [[C5]](s64)
47 %0(s1) = G_CONSTANT i1 0
48 %6:_(s32) = G_ANYEXT %0
50 %1(s8) = G_CONSTANT i8 42
51 %7:_(s32) = G_ANYEXT %1
53 %2(s16) = G_CONSTANT i16 65535
54 %8:_(s32) = G_ANYEXT %2
56 %3(s32) = G_CONSTANT i32 -1
58 %4(s64) = G_CONSTANT i64 1
60 %5(s64) = G_CONSTANT i64 0
73 ; CHECK-LABEL: name: test_fconstant
74 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 1.000000e+00
75 ; CHECK: $w0 = COPY [[C]](s32)
76 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_FCONSTANT double 2.000000e+00
77 ; CHECK: $x0 = COPY [[C1]](s64)
78 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_FCONSTANT float 0.000000e+00
79 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[C2]](s32)
80 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC]](s16)
81 ; CHECK: $w0 = COPY [[ANYEXT]](s32)
82 %0(s32) = G_FCONSTANT float 1.0
84 %1(s64) = G_FCONSTANT double 2.0
86 %2(s16) = G_FCONSTANT half 0.0
87 %3:_(s32) = G_ANYEXT %2
98 ; CHECK-LABEL: name: test_global
99 ; CHECK: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @var
100 ; CHECK: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[GV]](p0)
101 ; CHECK: $x0 = COPY [[PTRTOINT]](s64)
102 %0(p0) = G_GLOBAL_VALUE @var
103 %1:_(s64) = G_PTRTOINT %0