brintos

brintos / llvm-project-archived public Read only

0
0
Text · 813 B · db7f277 Raw
29 lines · cpp
1// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm -fextend-variable-liveness -o - | FileCheck %s2//3// Check we can correctly produce fake uses for function-level variables even4// when we have a return in a nested conditional and there is no code at the end5// of the function.6 7// CHECK-LABEL: define{{.*}}@_Z3fooi8// CHECK:         [[I_FAKE_USE:%[a-zA-Z0-9\.]+]] = load i32, ptr %i.addr9// CHECK:         call void (...) @llvm.fake.use(i32 [[I_FAKE_USE]])10// CHECK-LABEL: define{{.*}}@_ZN1C3barEi11// CHECK:         [[J_FAKE_USE:%[a-zA-Z0-9\.]+]] = load i32, ptr %j.addr12// CHECK:         call void (...) @llvm.fake.use(i32 [[J_FAKE_USE]])13 14void foo(int i) {15   while (0)16     if (1)17       return;18}19 20class C {21  void bar(int j);22};23 24void C::bar(int j) {25  while (0)26    if (1)27      return;28}29