[llvm] r256860 - [PlaceSafepoints] Add a test.
Manuel Jacob via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 5 11:40:58 PST 2016
Author: mjacob
Date: Tue Jan 5 13:40:58 2016
New Revision: 256860
URL: http://llvm.org/viewvc/llvm-project?rev=256860&view=rev
Log:
[PlaceSafepoints] Add a test.
Calls of functions with the "gc-leaf-function" attribute shouldn't be turned
into a safepoint.
Added:
llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll
Added: llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll?rev=256860&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll (added)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll Tue Jan 5 13:40:58 2016
@@ -0,0 +1,24 @@
+; RUN: opt %s -S -place-safepoints | FileCheck %s
+
+declare void @foo() "gc-leaf-function"
+
+; Calls of functions with the "gc-leaf-function" attribute shouldn't get
+; safepoints. An entry safepoint should get inserted, though.
+define void @test_leaf_function() gc "statepoint-example" {
+; CHECK-LABEL: test_leaf_function
+; CHECK: gc.statepoint.p0f_isVoidf
+; CHECK-NOT: statepoint
+; CHECK-NOT: gc.result
+entry:
+ call void @foo()
+ ret void
+}
+
+; This function is inlined when inserting a poll.
+declare void @do_safepoint()
+define void @gc.safepoint_poll() {
+; CHECK-LABEL: gc.safepoint_poll
+entry:
+ call void @do_safepoint()
+ ret void
+}
More information about the llvm-commits
mailing list