1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump %s | FileCheck %s
3 using size_t = unsigned long long;
5 // CHECK: LoopHintAttr {{.*}} Implicit unroll UnrollCount Numeric
6 // CHECK: LoopHintAttr {{.*}} Implicit unroll UnrollCount Numeric
7 // CHECK: LoopHintAttr {{.*}} Implicit unroll Unroll Disable
8 // CHECK: LoopHintAttr {{.*}} Implicit unroll Unroll Disable
10 int value_dependent(int n
) {
11 constexpr int N
= 100;
12 auto init
= [=]() { return Flag
? n
: 0UL; };
13 auto cond
= [=](size_t ix
) { return Flag
? ix
!= 0 : ix
< 10; };
14 auto iter
= [=](size_t ix
) {
15 return Flag
? ix
& ~(1ULL << __builtin_clzll(ix
)) : ix
+ 1;
18 #pragma unroll Flag ? 1 : N
19 for (size_t ix
= init(); cond(ix
); ix
= iter(ix
)) {
22 #pragma unroll Flag ? 0 : N
23 for (size_t ix
= init(); cond(ix
); ix
= iter(ix
)) {
29 void test_value_dependent(int n
) {
30 value_dependent
<true>(n
);