1 // REQUIRES: host-supports-jit
2 // UNSUPPORTED: system-aix
3 // RUN: cat %s | clang-repl -Xcc -Xclang -Xcc -verify | FileCheck %s
4 // RUN: %clang_cc1 -verify -fincremental-extensions -emit-llvm -o - %s \
5 // RUN: | FileCheck --check-prefix=CODEGEN-CHECK %s
7 // expected-no-diagnostics
9 //CODEGEN-CHECK-COUNT-2: define internal void @__stmts__
10 //CODEGEN-CHECK-NOT: define internal void @__stmts__
12 extern "C" int printf(const char*,...);
14 template <typename T
> T
call() { printf("called\n"); return T(); }
20 printf("i = %d\n", i
);
23 namespace Ns
{ void f(){ i
++; } }
30 printf("i = %d\n", i
);
33 for (; i
> 4; --i
) printf("i = %d\n", i
);
38 for (; i
> 4; --i
) { printf("i = %d\n", i
); };
41 int j
= i
; printf("j = %d\n", j
);
44 {i
= 0; printf("i = %d (global scope)\n", i
);}
47 while (int i
= 1) { printf("i = %d (while condition)\n", i
--); break; }
50 if (int i
= 2) printf("i = %d (if condition)\n", i
);
53 switch (int i
= 3) { default: printf("i = %d (switch condition)\n", i
); }
56 for (int i
= 4; i
> 3; --i
) printf("i = %d (for-init)\n", i
);
59 for (const auto &i
: "5") printf("i = %c (range-based for-init)\n", i
);
63 if (auto *b
=aa
) *b
+= 1;
65 for (auto *b
=aa
; b
; *b
+=1) ;