1 ; RUN: llc -mtriple=thumbv7m -arm-disable-cgp=false %s -o - | FileCheck %s
2 ; RUN: llc -mtriple=thumbv8m.main -arm-disable-cgp=false %s -o - | FileCheck %s
3 ; RUN: llc -mtriple=thumbv7 %s -arm-disable-cgp=false -o - | FileCheck %s
4 ; RUN: llc -mtriple=armv8 %s -arm-disable-cgp=false -o - | FileCheck %s
6 ; Test to check that ARMCodeGenPrepare doesn't optimised away sign extends.
7 ; CHECK-LABEL: test_signed_load:
9 define i16 @test_signed_load(i16* %ptr) {
10 %load = load i16, i16* %ptr
11 %conv0 = zext i16 %load to i32
12 %conv1 = sext i16 %load to i32
13 %cmp = icmp eq i32 %conv0, %conv1
14 %conv2 = zext i1 %cmp to i16
18 ; Don't allow sign bit generating opcodes.
19 ; CHECK-LABEL: test_ashr:
21 define i16 @test_ashr(i16 zeroext %arg) {
22 %ashr = ashr i16 %arg, 1
23 %cmp = icmp eq i16 %ashr, 0
24 %conv = zext i1 %cmp to i16
28 ; CHECK-LABEL: test_sdiv:
30 define i16 @test_sdiv(i16 zeroext %arg) {
31 %sdiv = sdiv i16 %arg, 2
32 %cmp = icmp ne i16 %sdiv, 0
33 %conv = zext i1 %cmp to i16
37 ; CHECK-LABEL: test_srem
39 define i16 @test_srem(i16 zeroext %arg) {
40 %srem = srem i16 %arg, 4
41 %cmp = icmp ne i16 %srem, 0
42 %conv = zext i1 %cmp to i16