Rafael Espindola | a3f55b0 | 2013-09-04 04:12:25 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s |
Tanya Lattner | 0df579e | 2012-07-09 22:06:01 +0000 | [diff] [blame] | 2 | |
Joey Gouly | 37453b9 | 2013-03-08 09:42:32 +0000 | [diff] [blame] | 3 | typedef unsigned int uint4 __attribute__((ext_vector_type(4))); |
Tanya Lattner | 0df579e | 2012-07-09 22:06:01 +0000 | [diff] [blame] | 4 | |
Joey Gouly | 37453b9 | 2013-03-08 09:42:32 +0000 | [diff] [blame] | 5 | kernel __attribute__((vec_type_hint(int))) __attribute__((reqd_work_group_size(1,2,4))) void kernel1(int a) {} |
| 6 | |
| 7 | kernel __attribute__((vec_type_hint(uint4))) __attribute__((work_group_size_hint(8,16,32))) void kernel2(int a) {} |
Tanya Lattner | 0df579e | 2012-07-09 22:06:01 +0000 | [diff] [blame] | 8 | |
| 9 | // CHECK: opencl.kernels = !{[[MDNODE0:![0-9]+]], [[MDNODE3:![0-9]+]]} |
| 10 | |
Stephen Hines | 0e2c34f | 2015-03-23 12:09:02 -0700 | [diff] [blame] | 11 | // CHECK: [[MDNODE0]] = !{void (i32)* @kernel1, {{.*}} [[MDNODE1:![0-9]+]], [[MDNODE2:![0-9]+]]} |
| 12 | // CHECK: [[MDNODE1]] = !{!"vec_type_hint", i32 undef, i32 1} |
| 13 | // CHECK: [[MDNODE2]] = !{!"reqd_work_group_size", i32 1, i32 2, i32 4} |
| 14 | // CHECK: [[MDNODE3]] = !{void (i32)* @kernel2, {{.*}} [[MDNODE4:![0-9]+]], [[MDNODE5:![0-9]+]]} |
| 15 | // CHECK: [[MDNODE4]] = !{!"vec_type_hint", <4 x i32> undef, i32 0} |
| 16 | // CHECK: [[MDNODE5]] = !{!"work_group_size_hint", i32 8, i32 16, i32 32} |