Debian Codegraph @

clang/test/CodeGen/fake-use-determinism.c

raw
1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fextend-variable-liveness %s -o - | FileCheck %s
2 //
3 // We are checking that the fake.use calls for i, j and k appear
4 // in a particular order. It is not the order itself that is important
5 // but that it remains the same between different test runs.
6
7 // CHECK: [[K_FAKE_USE:%[a-zA-Z0-9\.]+]] = load i32, ptr %k.addr
8 // CHECK-NEXT: call void (...) @llvm.fake.use(i32 [[K_FAKE_USE]])
9 // CHECK-NEXT: [[J_FAKE_USE:%[a-zA-Z0-9\.]+]] = load i32, ptr %j.addr
10 // CHECK-NEXT: call void (...) @llvm.fake.use(i32 [[J_FAKE_USE]])
11 // CHECK-NEXT: [[I_FAKE_USE:%[a-zA-Z0-9\.]+]] = load i32, ptr %i.addr
12 // CHECK-NEXT: call void (...) @llvm.fake.use(i32 [[I_FAKE_USE]])
13
14 void bar();
15 void foo(int i, int j, int k)
16 {
17 for (int l = 0; l < i; l++) {
18 bar();
19 }
20 }