[Github] Label lldb-dap PRs (#125139)
[llvm-project.git] / clang / test / CodeGen / fake-use-noreturn.cpp
blobdb7f27735b1d3f2dcb8c6dd0ced94da9b543f864
1 // RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm -fextend-variable-liveness -o - | FileCheck %s
2 //
3 // Check we can correctly produce fake uses for function-level variables even
4 // when we have a return in a nested conditional and there is no code at the end
5 // of the function.
7 // CHECK-LABEL: define{{.*}}@_Z3fooi
8 // CHECK: [[I_FAKE_USE:%[a-zA-Z0-9\.]+]] = load i32, ptr %i.addr
9 // CHECK: call void (...) @llvm.fake.use(i32 [[I_FAKE_USE]])
10 // CHECK-LABEL: define{{.*}}@_ZN1C3barEi
11 // CHECK: [[J_FAKE_USE:%[a-zA-Z0-9\.]+]] = load i32, ptr %j.addr
12 // CHECK: call void (...) @llvm.fake.use(i32 [[J_FAKE_USE]])
14 void foo(int i) {
15 while (0)
16 if (1)
17 return;
20 class C {
21 void bar(int j);
24 void C::bar(int j) {
25 while (0)
26 if (1)
27 return;