2017-10-19 07:18:12 +08:00
|
|
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
2017-02-23 02:47:41 +08:00
|
|
|
# RUN: llc -O0 -run-pass=legalizer -global-isel %s -o - | FileCheck %s
|
2016-08-20 06:40:00 +08:00
|
|
|
|
|
|
|
--- |
|
|
|
|
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
|
2016-10-14 18:19:40 +08:00
|
|
|
target triple = "aarch64--"
|
2016-08-20 06:40:00 +08:00
|
|
|
define void @test_constant() {
|
|
|
|
entry:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
define void @test_fconstant() {
|
|
|
|
entry:
|
|
|
|
ret void
|
|
|
|
}
|
2016-10-11 05:49:53 +08:00
|
|
|
@var = global i8 0
|
|
|
|
define i8* @test_global() { ret i8* undef }
|
2016-08-20 06:40:00 +08:00
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: test_constant
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
- { id: 2, class: _ }
|
|
|
|
- { id: 3, class: _ }
|
|
|
|
- { id: 4, class: _ }
|
2016-08-26 01:37:35 +08:00
|
|
|
- { id: 5, class: _ }
|
2016-08-20 06:40:00 +08:00
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_constant
|
|
|
|
; CHECK: [[C:%[0-9]+]](s32) = G_CONSTANT i32 0
|
|
|
|
; CHECK: [[TRUNC:%[0-9]+]](s1) = G_TRUNC [[C]](s32)
|
|
|
|
; CHECK: [[C1:%[0-9]+]](s32) = G_CONSTANT i32 42
|
|
|
|
; CHECK: [[TRUNC1:%[0-9]+]](s8) = G_TRUNC [[C1]](s32)
|
|
|
|
; CHECK: [[C2:%[0-9]+]](s32) = G_CONSTANT i32 -1
|
|
|
|
; CHECK: [[TRUNC2:%[0-9]+]](s16) = G_TRUNC [[C2]](s32)
|
|
|
|
; CHECK: [[C3:%[0-9]+]](s32) = G_CONSTANT i32 -1
|
|
|
|
; CHECK: [[C4:%[0-9]+]](s64) = G_CONSTANT i64 1
|
|
|
|
; CHECK: [[C5:%[0-9]+]](s64) = G_CONSTANT i64 0
|
2016-12-06 05:47:07 +08:00
|
|
|
%0(s1) = G_CONSTANT i1 0
|
|
|
|
%1(s8) = G_CONSTANT i8 42
|
|
|
|
%2(s16) = G_CONSTANT i16 65535
|
|
|
|
%3(s32) = G_CONSTANT i32 -1
|
|
|
|
%4(s64) = G_CONSTANT i64 1
|
|
|
|
%5(s64) = G_CONSTANT i64 0
|
2016-08-20 06:40:00 +08:00
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: test_fconstant
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
- { id: 2, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_fconstant
|
|
|
|
; CHECK: [[C:%[0-9]+]](s32) = G_FCONSTANT float 1.000000e+00
|
|
|
|
; CHECK: [[C1:%[0-9]+]](s64) = G_FCONSTANT double 2.000000e+00
|
|
|
|
; CHECK: [[C2:%[0-9]+]](s32) = G_FCONSTANT half 0xH0000
|
|
|
|
; CHECK: [[FPTRUNC:%[0-9]+]](s16) = G_FPTRUNC [[C2]](s32)
|
2016-09-09 19:46:34 +08:00
|
|
|
%0(s32) = G_FCONSTANT float 1.0
|
|
|
|
%1(s64) = G_FCONSTANT double 2.0
|
|
|
|
%2(s16) = G_FCONSTANT half 0.0
|
2016-08-20 06:40:00 +08:00
|
|
|
...
|
2016-10-11 05:49:53 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
name: test_global
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_global
|
|
|
|
; CHECK: [[GV:%[0-9]+]](p0) = G_GLOBAL_VALUE @var
|
2016-10-11 05:49:53 +08:00
|
|
|
%0(p0) = G_GLOBAL_VALUE @var
|
|
|
|
...
|