// RUN: %clang_cc1 -no-opaque-pointers -triple sparcv9-unknown-unknown -emit-llvm %s -o - | FileCheck %s
// CHECK-LABEL: define{{.*}} void @f_void()
void
// Arguments and return values smaller than the word size are extended.
// CHECK-LABEL: define{{.*}} signext i32 @f_int_1(i32 noundef signext %x)
int
// CHECK-LABEL: define{{.*}} zeroext i32 @f_int_2(i32 noundef zeroext %x)
unsigned
// CHECK-LABEL: define{{.*}} i64 @f_int_3(i64 noundef %x)
long long
// CHECK-LABEL: define{{.*}} signext i8 @f_int_4(i8 noundef signext %x)
char
// CHECK-LABEL: define{{.*}} fp128 @f_ld(fp128 noundef %x)
long double
// Small structs are passed in registers.
;
// CHECK-LABEL: define{{.*}} %struct.small @f_small(i32* %x.coerce0, i32* %x.coerce1)
struct small
// Medium-sized structs are passed indirectly, but can be returned in registers.
;
// CHECK-LABEL: define{{.*}} %struct.medium @f_medium(%struct.medium* noundef %x)
struct medium
// Large structs are also returned indirectly.
;
// CHECK-LABEL: define{{.*}} void @f_large(%struct.large* noalias sret(%struct.large) align 8 %agg.result, %struct.large* noundef %x)
struct large
// A 64-bit struct fits in a register.
;
// CHECK-LABEL: define{{.*}} i64 @f_reg(i64 %x.coerce)
struct reg
// Structs with mixed int and float parts require the inreg attribute.
;
// CHECK-LABEL: define{{.*}} inreg %struct.mixed @f_mixed(i32 inreg %x.coerce0, float inreg %x.coerce1)
struct mixed
// Struct with padding.
;
// CHECK: define{{.*}} { i64, double } @f_mixed2(i64 %x.coerce0, double %x.coerce1)
// CHECK: store i64 %x.coerce0
// CHECK: store double %x.coerce1
struct mixed2
// Struct with single element and padding in passed in the high bits of a
// register.
;
// CHECK-LABEL: define{{.*}} i64 @f_tiny(i64 %x.coerce)
// CHECK: %[[HB:[^ ]+]] = lshr i64 %x.coerce, 56
// CHECK: = trunc i64 %[[HB]] to i8
struct tiny
// CHECK-LABEL: define{{.*}} void @call_tiny()
// CHECK: %[[XV:[^ ]+]] = zext i8 %{{[^ ]+}} to i64
// CHECK: %[[HB:[^ ]+]] = shl i64 %[[XV]], 56
// CHECK: = call i64 @f_tiny(i64 %[[HB]])
void
// CHECK-LABEL: define{{.*}} signext i32 @f_variable(i8* noundef %f, ...)
// CHECK: %ap = alloca i8*
// CHECK: call void @llvm.va_start
//
int