xref: /llvm-project/clang/test/CodeGenOpenCL/byval.cl (revision d77c62053c944652846c00a35c921e14b43b1877)
1// RUN: %clang_cc1 -emit-llvm -o - -triple i686-pc-darwin %s | FileCheck -check-prefix=X86 %s
2// RUN: %clang_cc1 -emit-llvm -o - -triple amdgcn %s | FileCheck -check-prefix=AMDGCN %s
3struct A {
4  int x[100];
5};
6
7int f(struct A a);
8
9int g() {
10  struct A a;
11  // X86:    call i32 @f(ptr noundef nonnull byval(%struct.A) align 4 %a)
12  // AMDGCN: call i32 @f(ptr addrspace(5) noundef byref{{.*}}%a)
13  return f(a);
14}
15
16// X86:   declare i32 @f(ptr noundef byval(%struct.A) align 4)
17// AMDGCN: declare i32 @f(ptr addrspace(5) noundef byref{{.*}})
18