2015-05-27 03:44:52 +08:00
|
|
|
// RUN: %clang_cc1 -triple i686-windows-msvc -fms-extensions -emit-llvm -std=c++1y -O0 -o - %s | FileCheck %s
|
2014-09-12 07:05:02 +08:00
|
|
|
struct Base {};
|
|
|
|
|
|
|
|
// __declspec(dllexport) causes us to export the implicit constructor.
|
|
|
|
struct __declspec(dllexport) Derived : virtual Base {
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc %struct.Derived* @"??0Derived@@QAE@ABU0@@Z"
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK: %[[this:.*]] = load %struct.Derived*, %struct.Derived** {{.*}}
|
2014-09-12 07:05:02 +08:00
|
|
|
// CHECK-NEXT: store %struct.Derived* %[[this]], %struct.Derived** %[[retval:.*]]
|
2015-02-28 03:18:17 +08:00
|
|
|
// CHECK: %[[dest_a_gep:.*]] = getelementptr inbounds %struct.Derived, %struct.Derived* %[[this]], i32 0, i32 1
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK-NEXT: %[[src_load:.*]] = load %struct.Derived*, %struct.Derived** {{.*}}
|
2015-02-28 03:18:17 +08:00
|
|
|
// CHECK-NEXT: %[[src_a_gep:.*]] = getelementptr inbounds %struct.Derived, %struct.Derived* %[[src_load:.*]], i32 0, i32 1
|
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-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %[[dest_a_gep]], i8* align 4 %[[src_a_gep]], i64 1, i1 false)
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK-NEXT: %[[dest_this:.*]] = load %struct.Derived*, %struct.Derived** %[[retval]]
|
2014-09-12 07:05:02 +08:00
|
|
|
// CHECK-NEXT: ret %struct.Derived* %[[dest_this]]
|
|
|
|
bool a : 1;
|
|
|
|
bool b : 1;
|
|
|
|
};
|
2014-10-15 12:54:54 +08:00
|
|
|
|
|
|
|
// __declspec(dllexport) causes us to export the implicit copy constructor.
|
|
|
|
struct __declspec(dllexport) Derived2 : virtual Base {
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK-LABEL: define weak_odr dso_local dllexport x86_thiscallcc %struct.Derived2* @"??0Derived2@@QAE@ABU0@@Z"
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK: %[[this:.*]] = load %struct.Derived2*, %struct.Derived2** {{.*}}
|
2014-10-15 12:54:54 +08:00
|
|
|
// CHECK-NEXT: store %struct.Derived2* %[[this]], %struct.Derived2** %[[retval:.*]]
|
2015-02-28 03:18:17 +08:00
|
|
|
// CHECK: %[[dest_a_gep:.*]] = getelementptr inbounds %struct.Derived2, %struct.Derived2* %[[this]], i32 0, i32 1
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK-NEXT: %[[src_load:.*]] = load %struct.Derived2*, %struct.Derived2** {{.*}}
|
2015-02-28 03:18:17 +08:00
|
|
|
// CHECK-NEXT: %[[src_a_gep:.*]] = getelementptr inbounds %struct.Derived2, %struct.Derived2* %[[src_load:.*]], i32 0, i32 1
|
2014-10-15 12:54:54 +08:00
|
|
|
// CHECK-NEXT: %[[dest_a_bitcast:.*]] = bitcast [1 x i32]* %[[dest_a_gep]] to i8*
|
|
|
|
// CHECK-NEXT: %[[src_a_bitcast:.*]] = bitcast [1 x i32]* %[[src_a_gep]] 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-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %[[dest_a_bitcast]], i8* align 4 %[[src_a_bitcast]], i32 4, i1 false)
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK-NEXT: %[[dest_this:.*]] = load %struct.Derived2*, %struct.Derived2** %[[retval]]
|
2014-10-15 12:54:54 +08:00
|
|
|
// CHECK-NEXT: ret %struct.Derived2* %[[dest_this]]
|
|
|
|
int Array[1];
|
|
|
|
};
|