2015-10-03 06:41:59 +08:00
|
|
|
// RUN: %clang_cc1 -fblocks -triple arm64-apple-darwin %s -emit-llvm -o - | FileCheck %s
|
2014-03-29 23:09:45 +08:00
|
|
|
// rdar://12416433
|
|
|
|
|
|
|
|
struct stret { int x[100]; };
|
|
|
|
struct stret one = {{1}};
|
|
|
|
|
|
|
|
@interface Test @end
|
|
|
|
|
|
|
|
@implementation Test
|
|
|
|
+(struct stret) method { return one; }
|
|
|
|
@end
|
|
|
|
|
|
|
|
int main(int argc, const char **argv)
|
|
|
|
{
|
2017-07-01 00:28:15 +08:00
|
|
|
struct stret s;
|
|
|
|
s = [(id)(argc&~255) method];
|
2015-10-03 06:41:59 +08:00
|
|
|
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret [[T0:%[^,]+]]
|
|
|
|
// CHECK: [[T0P:%.*]] = bitcast %struct.stret* [[T0]] to i8*
|
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).
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
2018-01-20 01:12:54 +08:00
|
|
|
// CHECK: call void @llvm.memset.p0i8.i64(i8* align 4 [[T0P]], i8 0, i64 400, i1 false)
|
2014-03-29 23:09:45 +08:00
|
|
|
|
2017-07-01 00:28:15 +08:00
|
|
|
s = [Test method];
|
|
|
|
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret [[T1:%[^,]+]]
|
|
|
|
// CHECK-NOT: call void @llvm.memset.p0i8.i64(
|
|
|
|
|
|
|
|
[(id)(argc&~255) method];
|
|
|
|
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret [[T1:%[^,]+]]
|
|
|
|
// CHECK-NOT: call void @llvm.memset.p0i8.i64(
|
|
|
|
|
2015-10-03 06:41:59 +08:00
|
|
|
[Test method];
|
|
|
|
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret [[T1:%[^,]+]]
|
|
|
|
// CHECK-NOT: call void @llvm.memset.p0i8.i64(
|
|
|
|
}
|