2013-12-14 06:43:52 +08:00
|
|
|
// RUN: %clang_cc1 -triple i686-pc-mingw32 -fms-extensions -Wmicrosoft %s -emit-llvm -o - | FileCheck %s
|
2011-01-18 13:36:08 +08:00
|
|
|
|
|
|
|
class Test1 {
|
|
|
|
public:
|
|
|
|
int a;
|
|
|
|
};
|
|
|
|
|
|
|
|
void f1() {
|
|
|
|
Test1 var;
|
|
|
|
var.Test1::Test1();
|
|
|
|
|
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.memcpy.p0i8.p0i8.i32(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i32 4, i1 false)
|
2011-01-18 13:36:08 +08:00
|
|
|
var.Test1::Test1(var);
|
|
|
|
}
|
|
|
|
|
|
|
|
class Test2 {
|
|
|
|
public:
|
|
|
|
Test2() { a = 10; b = 10; }
|
|
|
|
int a;
|
|
|
|
int b;
|
|
|
|
};
|
|
|
|
|
|
|
|
void f2() {
|
|
|
|
// CHECK: %var = alloca %class.Test2, align 4
|
2013-12-14 06:43:52 +08:00
|
|
|
// CHECK-NEXT: call x86_thiscallcc void @_ZN5Test2C1Ev(%class.Test2* %var)
|
2011-01-18 13:36:08 +08:00
|
|
|
Test2 var;
|
|
|
|
|
2013-12-14 06:43:52 +08:00
|
|
|
// CHECK-NEXT: call x86_thiscallcc void @_ZN5Test2C1Ev(%class.Test2* %var)
|
2011-01-18 13:36:08 +08:00
|
|
|
var.Test2::Test2();
|
|
|
|
|
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.memcpy.p0i8.p0i8.i32(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i32 8, i1 false)
|
2011-01-18 13:36:08 +08:00
|
|
|
var.Test2::Test2(var);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Test3 {
|
|
|
|
public:
|
|
|
|
Test3() { a = 10; b = 15; c = 20; }
|
|
|
|
Test3(const Test3& that) { a = that.a; b = that.b; c = that.c; }
|
|
|
|
int a;
|
|
|
|
int b;
|
|
|
|
int c;
|
|
|
|
};
|
|
|
|
|
|
|
|
void f3() {
|
2013-12-14 06:43:52 +08:00
|
|
|
// CHECK: call x86_thiscallcc void @_ZN5Test3C1Ev(%class.Test3* %var)
|
2011-01-18 13:36:08 +08:00
|
|
|
Test3 var;
|
|
|
|
|
2013-12-14 06:43:52 +08:00
|
|
|
// CHECK-NEXT: call x86_thiscallcc void @_ZN5Test3C1Ev(%class.Test3* %var2)
|
2011-01-18 13:36:08 +08:00
|
|
|
Test3 var2;
|
|
|
|
|
2013-12-14 06:43:52 +08:00
|
|
|
// CHECK-NEXT: call x86_thiscallcc void @_ZN5Test3C1Ev(%class.Test3* %var)
|
2011-01-18 13:36:08 +08:00
|
|
|
var.Test3::Test3();
|
|
|
|
|
2014-07-18 23:52:10 +08:00
|
|
|
// CHECK-NEXT: call x86_thiscallcc void @_ZN5Test3C1ERKS_(%class.Test3* %var, %class.Test3* dereferenceable({{[0-9]+}}) %var2)
|
2011-01-18 13:36:08 +08:00
|
|
|
var.Test3::Test3(var2);
|
|
|
|
}
|