1 # RUN: llc -mtriple arm-- -run-pass=legalizer %s -o - | FileCheck %s
2 # RUN: llc -mtriple thumb-- -mattr=+v6t2 -run-pass=legalizer %s -o - | FileCheck %s
4 define void @test_constants() { ret void }
8 # CHECK-LABEL: name: test_constants
10 # CHECK: legalized: true
11 regBankSelected: false
13 tracksRegLiveness: true
27 %0(s32) = G_CONSTANT i32 42
28 ; CHECK: {{%[0-9]+}}:_(s32) = G_CONSTANT i32 42
30 %1(s16) = G_CONSTANT i16 21
31 G_STORE %1(s16), %4(p0) :: (store 2)
32 ; CHECK-NOT: G_CONSTANT i16
33 ; CHECK: [[EXT:%[0-9]+]]:_(s32) = G_CONSTANT i32 21
34 ; CHECK: {{%[0-9]+}}:_(s16) = G_TRUNC [[EXT]](s32)
35 ; CHECK-NOT: G_CONSTANT i16
37 %2(s8) = G_CONSTANT i8 10
38 G_STORE %2(s8), %4(p0) :: (store 1)
39 ; CHECK-NOT: G_CONSTANT i8
40 ; CHECK: [[EXT:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
41 ; CHECK: {{%[0-9]+}}:_(s8) = G_TRUNC [[EXT]](s32)
42 ; CHECK-NOT: G_CONSTANT i8
44 %3(s1) = G_CONSTANT i1 1
45 G_STORE %3(s1), %4(p0) :: (store 1)
46 ; CHECK-NOT: G_CONSTANT i1
47 ; CHECK: [[EXT:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
48 ; CHECK: {{%[0-9]+}}:_(s1) = G_TRUNC [[EXT]](s32)
49 ; CHECK-NOT: G_CONSTANT i1
51 %5(p0) = G_CONSTANT i32 0
52 G_STORE %5(p0), %4(p0) :: (store 4)
53 ; CHECK: {{%[0-9]+}}:_(p0) = G_CONSTANT i32 0
56 BX_RET 14, $noreg, implicit $r0