2013-11-21 04:35:34 +08:00
|
|
|
// RUN: %clang_cc1 -triple nvptx-unknown-unknown -S -o - %s -emit-llvm | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -triple nvptx64-unknown-unknown -S -o - %s -emit-llvm | FileCheck %s
|
|
|
|
|
|
|
|
typedef struct float4_s {
|
|
|
|
float x, y, z, w;
|
|
|
|
} float4_t;
|
|
|
|
|
2014-10-29 21:43:21 +08:00
|
|
|
float4_t my_function(void) {
|
2020-02-04 02:09:39 +08:00
|
|
|
// CHECK-LABEL: define %struct.float4_s @my_function
|
2014-10-29 21:43:21 +08:00
|
|
|
float4_t t;
|
|
|
|
return t;
|
|
|
|
};
|
2013-11-21 04:35:34 +08:00
|
|
|
|
|
|
|
float bar(void) {
|
|
|
|
float4_t ret;
|
2014-10-29 21:43:21 +08:00
|
|
|
// CHECK-LABEL: @bar
|
|
|
|
// CHECK: call %struct.float4_s @my_function
|
2013-11-21 04:35:34 +08:00
|
|
|
ret = my_function();
|
|
|
|
return ret.x;
|
|
|
|
}
|
2014-10-29 21:43:21 +08:00
|
|
|
|
|
|
|
void foo(float4_t x) {
|
|
|
|
// CHECK-LABEL: @foo
|
2019-06-06 05:12:14 +08:00
|
|
|
// CHECK: %struct.float4_s* byval(%struct.float4_s) align 4 %x
|
2014-10-29 21:43:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void fooN(float4_t x, float4_t y, float4_t z) {
|
|
|
|
// CHECK-LABEL: @fooN
|
2019-06-06 05:12:14 +08:00
|
|
|
// CHECK: %struct.float4_s* byval(%struct.float4_s) align 4 %x
|
|
|
|
// CHECK: %struct.float4_s* byval(%struct.float4_s) align 4 %y
|
|
|
|
// CHECK: %struct.float4_s* byval(%struct.float4_s) align 4 %z
|
2014-10-29 21:43:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct nested_s {
|
|
|
|
unsigned long long x;
|
|
|
|
float z[64];
|
|
|
|
float4_t t;
|
|
|
|
} nested_t;
|
|
|
|
|
|
|
|
void baz(nested_t x) {
|
|
|
|
// CHECK-LABEL: @baz
|
2019-06-06 05:12:14 +08:00
|
|
|
// CHECK: %struct.nested_s* byval(%struct.nested_s) align 8 %x)
|
2014-10-29 21:43:21 +08:00
|
|
|
}
|