summaryrefslogtreecommitdiff
path: root/test/CodeGen/cleanup-destslot-simple.c
diff options
context:
space:
mode:
authorArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>2015-04-10 10:13:52 +0000
committerArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>2015-04-10 10:13:52 +0000
commit914d1bd47f6252559e110929949d69a7a145881d (patch)
treeee6f946529a950f82dcac4c80668d4e360366db7 /test/CodeGen/cleanup-destslot-simple.c
parent0c6a04ea7e5f057f6a98d5198ce12840f8508c99 (diff)
downloadclang-914d1bd47f6252559e110929949d69a7a145881d.tar.gz
Remove threshold for inserting lifetime markers for named temporaries
Now that TailRecursionElimination has been fixed with r222354, the threshold on size for lifetime marker insertion can be removed. This only affects named temporary though, as the patch for unnamed temporaries is still in progress. My previous commit (r222993) was not handling debuginfo correctly, but this could only be seen with some asan tests. Basically, lifetime markers are just instrumentation for the compiler's usage and should not affect debug information; however, the cleanup infrastructure was assuming it contained only destructors, i.e. actual code to be executed, and was setting the breakpoint for the end of the function to the closing '}', and not the return statement, in order to show some destructors have been called when leaving the function. This is wrong when the cleanups are only lifetime markers, and this is now fixed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234581 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/cleanup-destslot-simple.c')
-rw-r--r--test/CodeGen/cleanup-destslot-simple.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/cleanup-destslot-simple.c b/test/CodeGen/cleanup-destslot-simple.c
new file mode 100644
index 0000000000..0ee52e1d9f
--- /dev/null
+++ b/test/CodeGen/cleanup-destslot-simple.c
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -O1 -triple x86_64-none-linux-gnu -emit-llvm -gline-tables-only %s -o - | FileCheck %s
+
+// There is no exception to handle here, lifetime.end is not a destructor,
+// so there is no need have cleanup dest slot related code
+// CHECK-LABEL: define i32 @test
+int test() {
+ int x = 3;
+ int *volatile p = &x;
+ return *p;
+// CHECK: [[X:%.*]] = alloca i32
+// CHECK: [[P:%.*]] = alloca i32*
+// CHECK: call void @llvm.lifetime.start(i64 4, i8* %{{.*}})
+// CHECK: call void @llvm.lifetime.start(i64 8, i8* %{{.*}})
+// CHECK-NOT: store i32 %{{.*}}, i32* %cleanup.dest.slot
+}