mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 19:36:05 +00:00

This adds -no-opaque-pointers to clang tests whose output will change when opaque pointers are enabled by default. This is intended to be part of the migration approach described in https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9. The patch has been produced by replacing %clang_cc1 with %clang_cc1 -no-opaque-pointers for tests that fail with opaque pointers enabled. Worth noting that this doesn't cover all tests, there's a remaining ~40 tests not using %clang_cc1 that will need a followup change. Differential Revision: https://reviews.llvm.org/D123115
51 lines
2.0 KiB
C++
51 lines
2.0 KiB
C++
// RUN: %clang_cc1 -no-opaque-pointers -triple=x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
|
|
// rdar://11861085
|
|
|
|
struct s {
|
|
char filler [128];
|
|
volatile int x;
|
|
};
|
|
|
|
struct s gs;
|
|
|
|
void foo (void) {
|
|
struct s ls;
|
|
ls = ls;
|
|
gs = gs;
|
|
ls = gs;
|
|
}
|
|
// CHECK-LABEL: define{{.*}} void @_Z3foov()
|
|
// CHECK: %[[LS:.*]] = alloca %struct.s, align 4
|
|
// CHECK-NEXT: %[[ZERO:.*]] = bitcast %struct.s* %[[LS]] to i8*
|
|
// CHECK-NEXT: %[[ONE:.*]] = bitcast %struct.s* %[[LS]] to i8*
|
|
// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* align 4 %[[ZERO]], i8* align 4 %[[ONE]], i64 132, i1 true)
|
|
// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* align 4 getelementptr inbounds (%struct.s, %struct.s* @gs, i32 0, i32 0, i32 0), i8* align 4 getelementptr inbounds (%struct.s, %struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i1 true)
|
|
// CHECK-NEXT: %[[TWO:.*]] = bitcast %struct.s* %[[LS]] to i8*
|
|
// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* align 4 %[[TWO]], i8* align 4 getelementptr inbounds (%struct.s, %struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i1 true)
|
|
|
|
|
|
struct s1 {
|
|
struct s y;
|
|
};
|
|
|
|
struct s1 s;
|
|
|
|
void fee (void) {
|
|
s = s;
|
|
s.y = gs;
|
|
}
|
|
// CHECK-LABEL: define{{.*}} void @_Z3feev()
|
|
// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 4 getelementptr inbounds (%struct.s1, %struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* align 4 getelementptr inbounds (%struct.s1, %struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i64 132, i1 true)
|
|
// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* align 4 getelementptr inbounds (%struct.s1, %struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* align 4 getelementptr inbounds (%struct.s, %struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i1 true)
|
|
|
|
struct d : s1 {
|
|
};
|
|
|
|
d gd;
|
|
|
|
void gorf(void) {
|
|
gd = gd;
|
|
}
|
|
// CHECK-LABEL: define{{.*}} void @_Z4gorfv()
|
|
// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 4 getelementptr inbounds (%struct.d, %struct.d* @gd, i32 0, i32 0, i32 0, i32 0, i32 0), i8* align 4 getelementptr inbounds (%struct.d, %struct.d* @gd, i32 0, i32 0, i32 0, i32 0, i32 0), i64 132, i1 true)
|