Author: Nigel Perks
Date: 2023-02-16T16:32:29Z
New Revision: 0871337d97f71cac2dbc9cce33c0ecca3c5e5f9c
URL:
https://github.com/llvm/llvm-project/commit/0871337d97f71cac2dbc9cce33c0ecca3c5e5f9c
DIFF:
https://github.com/llvm/llvm-project/commit/0871337d97f71cac2dbc9cce33c0ecca3c5e5f9c.diff
LOG: [XCore] Adapt Clang tests to opaque pointers.
Differential Revision: https://reviews.llvm.org/D144195
Added:
Modified:
clang/test/CodeGen/xcore-abi.c
clang/test/CodeGen/xcore-stringtype.c
Removed:
diff --git a/clang/test/CodeGen/xcore-abi.c b/clang/test/CodeGen/xcore-abi.c
index 28fdae57de72..4dd0f221533b 100644
--- a/clang/test/CodeGen/xcore-abi.c
+++ b/clang/test/CodeGen/xcore-abi.c
@@ -1,12 +1,12 @@
// REQUIRES: xcore-registered-target
-// RUN: %clang_cc1 -no-opaque-pointers -triple xcore -verify %s
+// RUN: %clang_cc1 -triple xcore -verify %s
_Static_assert(sizeof(long long) == 8, "sizeof long long is wrong");
_Static_assert(_Alignof(long long) == 4, "alignof long long is wrong");
_Static_assert(sizeof(double) == 8, "sizeof double is wrong");
_Static_assert(_Alignof(double) == 4, "alignof double is wrong");
-// RUN: %clang_cc1 -no-opaque-pointers -triple xcore-unknown-unknown
-fno-signed-char -fno-common -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple xcore-unknown-unknown -fno-signed-char -fno-common
-emit-llvm -o - %s | FileCheck %s
// CHECK: target triple = "xcore-unknown-unknown"
@@ -25,91 +25,77 @@ void testva (int n, ...) {
// CHECK-LABEL: testva
va_list ap;
va_start(ap,n);
- // CHECK: [[AP:%[a-z0-9]+]] = alloca i8*, align 4
- // CHECK: [[AP1:%[a-z0-9]+]] = bitcast i8** [[AP]] to i8*
- // CHECK: call void @llvm.va_start(i8* [[AP1]])
+ // CHECK: [[AP:%[a-z0-9]+]] = alloca ptr, align 4
+ // CHECK: [[V5:%[a-z0-9]+]] = alloca %struct.x, align 4
+ // CHECK: [[TMP:%[a-z0-9]+]] = alloca [4 x i32], align 4
+ // CHECK: call void @llvm.va_start(ptr [[AP]])
char* v1 = va_arg (ap, char*);
f(v1);
- // CHECK: [[I:%[a-z0-9]+]] = load i8*, i8** [[AP]]
- // CHECK: [[P:%[a-z0-9]+]] = bitcast i8* [[I]] to i8**
- // CHECK: [[IN:%[a-z0-9]+]] = getelementptr inbounds i8, i8* [[I]], i32 4
- // CHECK: store i8* [[IN]], i8** [[AP]]
- // CHECK: [[V1:%[a-z0-9]+]] = load i8*, i8** [[P]]
- // CHECK: store i8* [[V1]], i8** [[V:%[a-z0-9]+]], align 4
- // CHECK: [[V2:%[a-z0-9]+]] = load i8*, i8** [[V]], align 4
- // CHECK: call void @f(i8* noundef [[V2]])
+ // CHECK: [[I:%[a-z0-9]+]] = load ptr, ptr [[AP]]
+ // CHECK: [[IN:%[a-z0-9]+]] = getelementptr inbounds i8, ptr [[I]], i32 4
+ // CHECK: store ptr [[IN]], ptr [[AP]]
+ // CHECK: [[V1:%[a-z0-9]+]] = load ptr, ptr [[I]]
+ // CHECK: store ptr [[V1]], ptr [[V:%[a-z0-9]+]], align 4
+ // CHECK: [[V2:%[a-z0-9]+]] = load ptr, ptr [[V]], align 4
+ // CHECK: call void @f(ptr noundef [[V2]])
char v2 = va_arg (ap, char); // expected-warning{{second argument to
'va_arg' is of promotable type 'char'}}
f(&v2);
- // CHECK: [[I:%[a-z0-9]+]] = load i8*, i8** [[AP]]
- // CHECK: [[IN:%[a-z0-9]+]] = getelementptr inbounds i8, i8* [[I]], i32 4
- // CHECK: store i8* [[IN]], i8** [[AP]]
- // CHECK: [[V1:%[a-z0-9]+]] = load i8, i8* [[I]]
- // CHECK: store i8 [[V1]], i8* [[V:%[a-z0-9]+]], align 1
- // CHECK: call void @f(i8* noundef [[V]])
+ // CHECK: [[I:%[a-z0-9]+]] = load ptr, ptr [[AP]]
+ // CHECK: [[IN:%[a-z0-9]+]] = getelementptr inbounds i8, ptr [[I]], i32 4
+ // CHECK: store ptr [[IN]], ptr [[AP]]
+ // CHECK: [[V1:%[a-z0-9]+]] = load i8, ptr [[I]]
+ // CHECK: store i8 [[V1]], ptr [[V:%[a-z0-9]+]], align 1
+ // CHECK: call void @f(ptr noundef [[V]])
int v3 = va_arg (ap, int);
f(&v3);
- // CHECK: [[I:%[a-z0-9]+]] = load i8*, i8** [[AP]]
- // CHECK: [[P:%[a-z0-9]+]] = bitcast i8* [[I]] to i32*
- // CHECK: [[IN:%[a-z0-9]+]] = getelementptr inbounds i8, i8* [[I]], i32 4
- // CHECK: store i8* [[IN]], i8** [[AP]]
- // CHECK: [[V1:%[a-z0-9]+]] = load i32, i32* [[P]]
- // CHECK: store i32 [[V1]], i32* [[V:%[a-z0-9]+]], align 4
- // CHECK: [[V2:%[a-z0-9]+]] = bitcast i32* [[V]] to i8*
- // CHECK: call void @f(i8* noundef [[V2]])
+ // CHECK: [[I:%[a-z0-9]+]] = load ptr, ptr [[AP]]
+ // CHECK: [[IN:%[a-z0-9]+]] = getelementptr inbounds i8, ptr [[I]], i32 4
+ // CHECK: store ptr [[IN]], ptr [[AP]]
+ // CHECK: [[V1:%[a-z0-9]+]] = load i32, ptr [[I]]
+ // CHECK: store i32 [[V1]], ptr [[V:%[a-z0-9]+]], align 4
+ // CHECK: call void @f(ptr noundef [[V]])
long long int v4 = va_arg (ap, long long int);
f(&v4);
- // CHECK: [[I:%[a-z0-9]+]] = load i8*, i8** [[AP]]
- // CHECK: [[P:%[a-z0-9]+]] = bitcast i8* [[I]] to i64*
- // CHECK: [[IN:%[a-z0-9]+]] = getelementptr inbounds i8, i8* [[I]], i32 8
- // CHECK: store i8* [[IN]], i8** [[AP]]
- // CHECK: [[V1:%[a-z0-9]+]] = load i64, i64* [[P]]
- // CHECK: store i64 [[V1]], i64* [[V:%[a-z0-9]+]], align 4
- // CHECK:[[V2:%[a-z0-9]+]] = bitcast i6