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 (s16))
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 (s8))
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 %6:_(s32) = G_CONSTANT i32 99
46 %7:_(s32) = G_SELECT %3, %0, %6
47 G_STORE %7(s32), %4(p0) :: (store (s32))
48 ; CHECK-NOT: G_CONSTANT i1
49 ; CHECK: [[EXT:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
50 ; CHECK: {{%[0-9]+}}:_(s1) = G_TRUNC [[EXT]](s32)
51 ; CHECK-NOT: G_CONSTANT i1
53 %5(p0) = G_CONSTANT i32 0
55 G_STORE %5(p0), %4(p0) :: (store (p0))
56 ; CHECK: {{%[0-9]+}}:_(p0) = G_CONSTANT i32 0
59 BX_RET 14, $noreg, implicit $r0