blob: 3e8640fd34b8d6dd744d4b78d80f7adf5e1f46dd [file] [log] [blame]
Colin LeMahieub8575b12015-06-13 21:46:39 +00001; RUN: llc -march=hexagon < %s | FileCheck %s
Jyotsna Vermaaf2359b2013-04-23 21:17:40 +00002
3; Check that we don't generate an invalid packet with too many instructions
4; due to a store that has a must-extend operand.
5
6; CHECK: CuSuiteAdd.exit.us
Jyotsna Vermaaf2359b2013-04-23 21:17:40 +00007; CHECK-NOT: call abort
8; CHECK: memw(##0)
Colin LeMahieub8575b12015-06-13 21:46:39 +00009; CHECK: memw(r{{[0-9+]}}{{ *}}<<{{ *}}#2{{ *}}+{{ *}}##4)
Jyotsna Vermaaf2359b2013-04-23 21:17:40 +000010
11%struct.CuTest.1.28.31.37.40.43.52.55.67.85.111 = type { i8*, void (%struct.CuTest.1.28.31.37.40.43.52.55.67.85.111*)*, i32, i32, i8*, [23 x i32]* }
12%struct.CuSuite.2.29.32.38.41.44.53.56.68.86.112 = type { i32, [1024 x %struct.CuTest.1.28.31.37.40.43.52.55.67.85.111*], i32 }
13
14@__func__.CuSuiteAdd = external unnamed_addr constant [11 x i8], align 8
15@.str24 = external unnamed_addr constant [140 x i8], align 8
16
17declare void @_Assert()
18
19define void @CuSuiteAddSuite() nounwind {
20entry:
21 br i1 undef, label %for.body.us, label %for.end
22
23for.body.us: ; preds = %entry
David Blaikiea79ac142015-02-27 21:17:42 +000024 %0 = load %struct.CuTest.1.28.31.37.40.43.52.55.67.85.111*, %struct.CuTest.1.28.31.37.40.43.52.55.67.85.111** null, align 4
25 %1 = load i32, i32* undef, align 4
Jyotsna Vermaaf2359b2013-04-23 21:17:40 +000026 %cmp.i.us = icmp slt i32 %1, 1024
27 br i1 %cmp.i.us, label %CuSuiteAdd.exit.us, label %cond.false6.i.us
28
29cond.false6.i.us: ; preds = %for.body.us
30 tail call void @_Assert() nounwind
31 unreachable
32
33CuSuiteAdd.exit.us: ; preds = %for.body.us
David Blaikie79e6c742015-02-27 19:29:02 +000034 %arrayidx.i.us = getelementptr inbounds %struct.CuSuite.2.29.32.38.41.44.53.56.68.86.112, %struct.CuSuite.2.29.32.38.41.44.53.56.68.86.112* null, i32 0, i32 1, i32 %1
Jyotsna Vermaaf2359b2013-04-23 21:17:40 +000035 store %struct.CuTest.1.28.31.37.40.43.52.55.67.85.111* %0, %struct.CuTest.1.28.31.37.40.43.52.55.67.85.111** %arrayidx.i.us, align 4
36 call void @llvm.trap()
37 unreachable
38
39for.end: ; preds = %entry
40 ret void
41}
42
43declare void @llvm.trap() noreturn nounwind