xref: /llvm-project/clang/test/CodeGen/fake-use-while.c (revision 4424c44c8c4ec8e071f5c5999fba216d36fb92c9)
1 // RUN: %clang_cc1 %s -emit-llvm -fextend-variable-liveness -o - | FileCheck %s
2 //
3 // Check we don't assert when there is no more code after a while statement
4 // and the body of the while statement ends in a return, i.e. no insertion point
5 // is available.
6 
7 // CHECK: define{{.*}}foo
8 // CHECK: call{{.*}}llvm.fake.use
9 
10 void foo() {
11   {
12     while (1) {
13       int ret;
14       if (1)
15         return;
16     }
17   }
18 }
19