diff options
author | dim <dim@FreeBSD.org> | 2010-09-17 15:54:40 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2010-09-17 15:54:40 +0000 |
commit | 36c49e3f258dced101949edabd72e9bc3f1dedc4 (patch) | |
tree | 0bbe07708f7571f8b5291f6d7b96c102b7c99dee /test/CodeGen/x86_64-arguments.c | |
parent | fc84956ac8b7cd244ef30e7a4d4d38a58dec5904 (diff) | |
download | FreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.zip FreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.tar.gz |
Vendor import of clang r114020 (from the release_28 branch):
http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020
Approved by: rpaulo (mentor)
Diffstat (limited to 'test/CodeGen/x86_64-arguments.c')
-rw-r--r-- | test/CodeGen/x86_64-arguments.c | 122 |
1 files changed, 118 insertions, 4 deletions
diff --git a/test/CodeGen/x86_64-arguments.c b/test/CodeGen/x86_64-arguments.c index cc318dc..51a234d 100644 --- a/test/CodeGen/x86_64-arguments.c +++ b/test/CodeGen/x86_64-arguments.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o %t %s -// RUN: FileCheck < %t %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s| FileCheck %s +#include <stdarg.h> // CHECK: %0 = type { i64, double } @@ -63,8 +63,8 @@ void f10(struct s10 a0) {} // CHECK: define void @f11(%struct.s19* sret %agg.result) union { long double a; float b; } f11() { while (1) {} } -// CHECK: define i64 @f12_0() -// CHECK: define void @f12_1(i64 %a0.coerce) +// CHECK: define i32 @f12_0() +// CHECK: define void @f12_1(i32 %a0.coerce) struct s12 { int a __attribute__((aligned(16))); }; struct s12 f12_0(void) { while (1) {} } void f12_1(struct s12 a0) {} @@ -131,3 +131,117 @@ void f22(L x, L y) { } // CHECK: %y = alloca{{.*}}, align 16 + +// PR7714 +struct f23S { + short f0; + unsigned f1; + int f2; +}; + + +void f23(int A, struct f23S B) { + // CHECK: define void @f23(i32 %A, i64 %B.coerce0, i32 %B.coerce1) +} + +struct f24s { long a; int b; }; + +struct f23S f24(struct f23S *X, struct f24s *P2) { + return *X; + + // CHECK: define %struct.f24s @f24(%struct.f23S* %X, %struct.f24s* %P2) +} + +// rdar://8248065 +typedef float v4f32 __attribute__((__vector_size__(16))); +v4f32 f25(v4f32 X) { + // CHECK: define <4 x float> @f25(<4 x float> %X) + // CHECK-NOT: alloca + // CHECK: alloca <4 x float> + // CHECK-NOT: alloca + // CHECK: store <4 x float> %X, <4 x float>* + // CHECK-NOT: store + // CHECK: ret <4 x float> + return X+X; +} + +struct foo26 { + int *X; + float *Y; +}; + +struct foo26 f26(struct foo26 *P) { + // CHECK: define %struct.foo26 @f26(%struct.foo26* %P) + return *P; +} + + +struct v4f32wrapper { + v4f32 v; +}; + +struct v4f32wrapper f27(struct v4f32wrapper X) { + // CHECK: define <4 x float> @f27(<4 x float> %X.coerce) + return X; +} + +// rdar://5711709 +struct f28c { + double x; + int y; +}; +void f28(struct f28c C) { + // CHECK: define void @f28(double %C.coerce0, i32 %C.coerce1) +} + +struct f29a { + struct c { + double x; + int y; + } x[1]; +}; + +void f29a(struct f29a A) { + // CHECK: define void @f29a(double %A.coerce0, i32 %A.coerce1) +} + +// rdar://8249586 +struct S0 { char f0[8]; char f2; char f3; char f4; }; +void f30(struct S0 p_4) { + // CHECK: define void @f30(i64 %p_4.coerce0, i24 %p_4.coerce1) +} + +// Pass the third element as a float when followed by tail padding. +// rdar://8251384 +struct f31foo { float a, b, c; }; +float f31(struct f31foo X) { + // CHECK: define float @f31(<2 x float> %X.coerce0, float %X.coerce1) + return X.c; +} + +_Complex float f32(_Complex float A, _Complex float B) { + // rdar://6379669 + // CHECK: define <2 x float> @f32(<2 x float> %A.coerce, <2 x float> %B.coerce) + return A+B; +} + + +// rdar://8357396 +struct f33s { long x; float c,d; }; + +void f33(va_list X) { + va_arg(X, struct f33s); +} + +typedef unsigned long long v1i64 __attribute__((__vector_size__(8))); + +// rdar://8359248 +// CHECK: define i64 @f34(i64 %arg.coerce) +v1i64 f34(v1i64 arg) { return arg; } + + +// rdar://8358475 +// CHECK: define i64 @f35(i64 %arg.coerce) +typedef unsigned long v1i64_2 __attribute__((__vector_size__(8))); +v1i64_2 f35(v1i64_2 arg) { return arg+arg; } + |