[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / clang / test / Interpreter / execute-stmts.cpp
blob433c6811777dac2289850bf7d78549b22e6d1893
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(); }
15 call<int>();
16 // CHECK: called
18 int i = 1;
19 ++i;
20 printf("i = %d\n", i);
21 // CHECK: i = 2
23 namespace Ns { void f(){ i++; } }
24 Ns::f();
26 void g() { ++i; }
27 g();
28 ::g();
30 printf("i = %d\n", i);
31 // CHECK-NEXT: i = 5
33 for (; i > 4; --i) printf("i = %d\n", i);
34 // CHECK-NEXT: i = 5
36 {++i;}
38 for (; i > 4; --i) { printf("i = %d\n", i); };
39 // CHECK-NEXT: i = 5
41 int j = i; printf("j = %d\n", j);
42 // CHECK-NEXT: j = 4
44 {i = 0; printf("i = %d (global scope)\n", i);}
45 // CHECK-NEXT: i = 0
47 while (int i = 1) { printf("i = %d (while condition)\n", i--); break; }
48 // CHECK-NEXT: i = 1
50 if (int i = 2) printf("i = %d (if condition)\n", i);
51 // CHECK-NEXT: i = 2
53 switch (int i = 3) { default: printf("i = %d (switch condition)\n", i); }
54 // CHECK-NEXT: i = 3
56 for (int i = 4; i > 3; --i) printf("i = %d (for-init)\n", i);
57 // CHECK-NEXT: i = 4
59 for (const auto &i : "5") printf("i = %c (range-based for-init)\n", i);
60 // CHECK-NEXT: i = 5
62 int *aa=nullptr;
63 if (auto *b=aa) *b += 1;
64 while (auto *b=aa) ;
65 for (auto *b=aa; b; *b+=1) ;