blob: c7e20491a9bc13a901ff6b406fcda1e73cf6e2d2 [file] [log] [blame]
Guy Benyei1db70402013-03-24 13:58:12 +00001// RUN: %clang_cc1 %s -cl-kernel-arg-info -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
Tanya Lattner198871c2012-07-11 23:02:10 +00002
Guy Benyei1db70402013-03-24 13:58:12 +00003kernel void foo(__global int * restrict X, const int Y,
4 volatile int anotherArg, __constant float * restrict Z) {
Tanya Lattner198871c2012-07-11 23:02:10 +00005 *X = Y + anotherArg;
6}
7
Guy Benyei1db70402013-03-24 13:58:12 +00008// CHECK: metadata !{metadata !"kernel_arg_addr_space", i32 1, i32 0, i32 0, i32 2}
9// CHECK: metadata !{metadata !"kernel_arg_access_qual", metadata !"none", metadata !"none", metadata !"none", metadata !"none"}
10// CHECK: metadata !{metadata !"kernel_arg_type", metadata !"int*", metadata !"int", metadata !"int", metadata !"float*"}
11// CHECK: metadata !{metadata !"kernel_arg_type_qual", metadata !"restrict", metadata !"const", metadata !"volatile", metadata !"restrict const"}
12// CHECK: metadata !{metadata !"kernel_arg_name", metadata !"X", metadata !"Y", metadata !"anotherArg", metadata !"Z"}
13
14kernel void foo2(read_only image1d_t img1, image2d_t img2, write_only image2d_array_t img3) {
15}
16// CHECK: metadata !{metadata !"kernel_arg_addr_space", i32 0, i32 0, i32 0}
17// CHECK: metadata !{metadata !"kernel_arg_access_qual", metadata !"read_only", metadata !"read_only", metadata !"write_only"}
18// CHECK: metadata !{metadata !"kernel_arg_type", metadata !"image1d_t", metadata !"image2d_t", metadata !"image2d_array_t"}
19// CHECK: metadata !{metadata !"kernel_arg_type_qual", metadata !"", metadata !"", metadata !""}
20// CHECK: metadata !{metadata !"kernel_arg_name", metadata !"img1", metadata !"img2", metadata !"img3"}