]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/cleanup-destslot-simple.c
Vendor import of clang trunk r238337:
[FreeBSD/FreeBSD.git] / test / CodeGen / cleanup-destslot-simple.c
1 // RUN: %clang_cc1 -O1 -triple x86_64-none-linux-gnu -emit-llvm -gline-tables-only %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=LIFETIME
2
3 // We shouldn't have markers at -O0 or with msan.
4 // RUN: %clang_cc1 -O0 -triple x86_64-none-linux-gnu -emit-llvm -gline-tables-only %s -o - | FileCheck %s --check-prefix=CHECK
5 // RUN: %clang_cc1 -O1 -triple x86_64-none-linux-gnu -emit-llvm -gline-tables-only %s -o - -fsanitize=memory | FileCheck %s --check-prefix=CHECK
6
7 // There is no exception to handle here, lifetime.end is not a destructor,
8 // so there is no need have cleanup dest slot related code
9 // CHECK-LABEL: define i32 @test
10 int test() {
11   int x = 3;
12   int *volatile p = &x;
13   return *p;
14 // CHECK: [[X:%.*]] = alloca i32
15 // CHECK: [[P:%.*]] = alloca i32*
16 // LIFETIME: call void @llvm.lifetime.start(i64 4, i8* %{{.*}})
17 // LIFETIME: call void @llvm.lifetime.start(i64 8, i8* %{{.*}})
18 // CHECK-NOT: store i32 %{{.*}}, i32* %cleanup.dest.slot
19 }