summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/xcore-abi.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/xcore-abi.c')
-rw-r--r--clang/test/CodeGen/xcore-abi.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/clang/test/CodeGen/xcore-abi.c b/clang/test/CodeGen/xcore-abi.c
index 56bec3d6b31..10881de7cec 100644
--- a/clang/test/CodeGen/xcore-abi.c
+++ b/clang/test/CodeGen/xcore-abi.c
@@ -1,3 +1,10 @@
+// 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 -triple xcore-unknown-unknown -fno-signed-char -fno-common -emit-llvm -o - %s | FileCheck %s
// CHECK: target datalayout = "e-p:32:32:32-a0:0:32-n32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f16:16:32-f32:32:32-f64:32:32"
@@ -28,7 +35,7 @@ void testva (int n, ...) {
// CHECK: [[V2:%[a-z0-9]+]] = load i8** [[V]], align 4
// CHECK: call void @f(i8* [[V2]])
- char v2 = va_arg (ap, char);
+ 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** [[AP]]
// CHECK: [[IN:%[a-z0-9]+]] = getelementptr i8* [[I]], i32 4
@@ -55,7 +62,7 @@ void testva (int n, ...) {
// CHECK: [[IN:%[a-z0-9]+]] = getelementptr i8* [[I]], i32 8
// CHECK: store i8* [[IN]], i8** [[AP]]
// CHECK: [[V1:%[a-z0-9]+]] = load i64* [[P]]
- // CHECK: store i64 [[V1]], i64* [[V:%[a-z0-9]+]], align 8
+ // CHECK: store i64 [[V1]], i64* [[V:%[a-z0-9]+]], align 4
// CHECK:[[V2:%[a-z0-9]+]] = bitcast i64* [[V]] to i8*
// CHECK: call void @f(i8* [[V2]])
@@ -95,7 +102,7 @@ void testva (int n, ...) {
// CHECK: [[IN:%[a-z0-9]+]] = getelementptr i8* [[I]], i32 8
// CHECK: store i8* [[IN]], i8** [[AP]]
// CHECK: [[V1:%[a-z0-9]+]] = load double* [[P]]
- // CHECK: store double [[V1]], double* [[V:%[a-z0-9]+]], align 8
+ // CHECK: store double [[V1]], double* [[V:%[a-z0-9]+]], align 4
// CHECK: [[V2:%[a-z0-9]+]] = bitcast double* [[V]] to i8*
// CHECK: call void @f(i8* [[V2]])
}
OpenPOWER on IntegriCloud