Summary: Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset intrinsics. This change updates the Clang tests for this change. The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument which is required to be a constant integer. It represents the alignment of the dest (and source), and so must be the minimum of the actual alignment of the two. This change removes the alignment argument in favour of placing the alignment attribute on the source and destination pointers of the memory intrinsic call. For example, code which used to read: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false) will now read call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false) At this time the source and destination alignments must be the same (Step 1). Step 2 of the change, to be landed shortly, will relax that contraint and allow the source and destination to have different alignments. llvm-svn: 322964
32 lines
1.2 KiB
C++
32 lines
1.2 KiB
C++
// RUN: %clang_cc1 -std=c++1y -triple i686-pc-windows-msvc -emit-llvm %s -o - | FileCheck %s
|
|
//CHECK: %[[A_LAMBDA:.*]] = type { %struct.A }
|
|
//CHECK: %[[B_LAMBDA:.*]] = type { %struct.B* }
|
|
struct A {
|
|
double a = 111;
|
|
auto foo() { return [*this] { return a; }; }
|
|
};
|
|
|
|
namespace ns1 {
|
|
int X = A{}.foo()();
|
|
} //end ns1
|
|
|
|
//CHECK: @"\01?foo@A@@QAE?A?<auto>@@XZ"(%struct.A* %this, %class.anon* noalias sret %[[A_LAMBDA_RETVAL:.*]])
|
|
// get the first object with the closure type, which is of type 'struct.A'
|
|
//CHECK: %[[I0:.+]] = getelementptr inbounds %[[A_LAMBDA]], %[[A_LAMBDA]]* %[[A_LAMBDA_RETVAL]], i32 0, i32 0
|
|
//CHECK: %[[I1:.+]] = bitcast %struct.A* %[[I0]] to i8*
|
|
//CHECK: %[[I2:.+]] = bitcast %struct.A* %this1 to i8*
|
|
// copy the contents ...
|
|
//CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %[[I1]], i8* align 8 %[[I2]], i32 8, i1 false)
|
|
|
|
struct B {
|
|
double b = 222;
|
|
auto bar() { return [this] { return b; }; };
|
|
};
|
|
|
|
namespace ns2 {
|
|
int X = B{}.bar()();
|
|
}
|
|
//CHECK: @"\01?bar@B@@QAE?A?<auto>@@XZ"(%struct.B* %this, %class.anon.0* noalias sret %agg.result)
|
|
//CHECK: %[[I20:.+]] = getelementptr inbounds %class.anon.0, %class.anon.0* %agg.result, i32 0, i32 0
|
|
//CHECK: store %struct.B* %this1, %struct.B** %[[I20]], align 4
|