1 // RUN
: %clang_cc1 -emit-llvm -O0 -cl-std
=CL2.0 -o - %s | FileCheck %s
2 // RUN
: %clang_cc1 -emit-llvm -O0 -cl-std
=CL1.2 -o - %s | FileCheck %s
7 // CHECK-LABEL
: for_count
8 __attribute__
((opencl_unroll_hint(8)))
9 for
( int i
= 0; i < 1000; ++i);
10 // CHECK
: br label %
{{.
*}}, !llvm.loop
![[FOR_COUNT
:.
*]]
15 // CHECK-LABEL
: for_disable
16 __attribute__
((opencl_unroll_hint(1)))
17 for
( int i
= 0; i < 1000; ++i);
18 // CHECK
: br label %
{{.
*}}, !llvm.loop
![[FOR_DISABLE
:.
*]]
23 // CHECK-LABEL
: for_enable
24 __attribute__
((opencl_unroll_hint))
25 for
( int i
= 0; i < 1000; ++i);
26 // CHECK
: br label %
{{.
*}}, !llvm.loop
![[FOR_ENABLE
:.
*]]
32 // CHECK-LABEL
: while_count
34 __attribute__
((opencl_unroll_hint(8)))
36 // CHECK
: br label %
{{.
*}}, !llvm.loop
![[WHILE_COUNT
:.
*]]
41 // CHECK-LABEL
: while_disable
43 __attribute__
((opencl_unroll_hint(1)))
45 // CHECK
: br label %
{{.
*}}, !llvm.loop
![[WHILE_DISABLE
:.
*]]
50 // CHECK-LABEL
: while_enable
52 __attribute__
((opencl_unroll_hint))
54 // CHECK
: br label %
{{.
*}}, !llvm.loop
![[WHILE_ENABLE
:.
*]]
60 // CHECK-LABEL
: do_count
62 __attribute__
((opencl_unroll_hint(8)))
64 // CHECK
: br i1 %
{{.
*}}, label %
{{.
*}}, label %
{{.
*}}, !llvm.loop
![[DO_COUNT
:.
*]]
69 // CHECK-LABEL
: do_disable
71 __attribute__
((opencl_unroll_hint(1)))
73 // CHECK
: br i1 %
{{.
*}}, label %
{{.
*}}, label %
{{.
*}}, !llvm.loop
![[DO_DISABLE
:.
*]]
78 // CHECK-LABEL
: do_enable
80 __attribute__
((opencl_unroll_hint))
82 // CHECK
: br i1 %
{{.
*}}, label %
{{.
*}}, label %
{{.
*}}, !llvm.loop
![[DO_ENABLE
:.
*]]
86 // CHECK
: ![[FOR_COUNT]] = distinct !{![[FOR_COUNT]], ![[COUNT
:.
*]]}
87 // CHECK
: ![[COUNT]] = !{!"llvm.loop.unroll.count", i32 8}
88 // CHECK: ![[FOR_DISABLE]] = distinct !{![[FOR_DISABLE]], ![[DISABLE:.*]]}
89 // CHECK: ![[DISABLE]] = !{!"llvm.loop.unroll.disable"}
90 // CHECK: ![[FOR_ENABLE]] = distinct !{![[FOR_ENABLE]], ![[ENABLE:.*]]}
91 // CHECK: ![[ENABLE]] = !{!"llvm.loop.unroll.enable"}
92 // CHECK: ![[WHILE_COUNT]] = distinct !{![[WHILE_COUNT]], ![[COUNT]]}
93 // CHECK
: ![[WHILE_DISABLE]] = distinct !{![[WHILE_DISABLE]], ![[DISABLE]]}
94 // CHECK: ![[WHILE_ENABLE]] = distinct !{![[WHILE_ENABLE]], ![[ENABLE]]}
95 // CHECK: ![[DO_COUNT]] = distinct !{![[DO_COUNT]], ![[COUNT]]}
96 // CHECK: ![[DO_DISABLE]] = distinct !{![[DO_DISABLE]], ![[DISABLE]]}
97 // CHECK
: ![[DO_ENABLE]] = distinct !{![[DO_ENABLE]], ![[ENABLE]]}