From: Sanjay Patel Date: Wed, 16 May 2018 14:38:07 +0000 (+0000) Subject: [OpenCL] make test independent of optimizer X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac0a9437afccc0d9bafce381a8376bae74ebb287;p=clang [OpenCL] make test independent of optimizer There shouldn't be any tests that run the entire optimizer here, but the last test in this file is definitely going to break with a change in LLVM IR canonicalization. Change that part to check the unoptimized IR because that's the real intent of this file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332473 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenOpenCL/shifts.cl b/test/CodeGenOpenCL/shifts.cl index 14cd7aff65..7011a4234b 100644 --- a/test/CodeGenOpenCL/shifts.cl +++ b/test/CodeGenOpenCL/shifts.cl @@ -58,16 +58,17 @@ int4 vectorVectorTest(int4 a,int4 b) { return f; } -//OPT: @vectorScalarTest +//NOOPT-LABEL: @vectorScalarTest int4 vectorScalarTest(int4 a,int b) { - //OPT: [[SP0:%.+]] = insertelement <4 x i32> undef, i32 %b, i32 0 - //OPT: [[SP1:%.+]] = shufflevector <4 x i32> [[SP0]], <4 x i32> undef, <4 x i32> zeroinitializer - //OPT: [[VSM:%.+]] = and <4 x i32> [[SP1]], - //OPT-NEXT: [[VSC:%.+]] = shl <4 x i32> %a, [[VSM]] + //NOOPT: [[SP0:%.+]] = insertelement <4 x i32> undef + //NOOPT: [[SP1:%.+]] = shufflevector <4 x i32> [[SP0]], <4 x i32> undef, <4 x i32> zeroinitializer + //NOOPT: [[VSM:%.+]] = and <4 x i32> [[SP1]], + //NOOPT: [[VSC:%.+]] = shl <4 x i32> [[VSS:%.+]], [[VSM]] int4 c = a << b; - //OPT-NEXT: [[VSF:%.+]] = add <4 x i32> [[VSC]], + //NOOPT: [[VSF:%.+]] = shl <4 x i32> [[VSC1:%.+]], + //NOOPT: [[VSA:%.+]] = add <4 x i32> [[VSC2:%.+]], [[VSF]] int4 d = {1, 1, 1, 1}; int4 f = c + (d << 34); - //OPT-NEXT: ret <4 x i32> [[VSF]] + //NOOPT: ret <4 x i32> return f; }