1 //===-- main.cpp ------------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 void __attribute__((noinline)) sink() {
12 x++; //% self.filecheck("finish", "main.cpp", "-implicit-check-not=artificial")
13 // CHECK: stop reason = step out
14 // CHECK-NEXT: Stepped out past: frame #1: 0x{{[0-9a-f]+}} a.out`func3{{.*}} [opt] [artificial]
15 // CHECK: frame #0: 0x{{[0-9a-f]+}} a.out`func2{{.*}} [opt]
18 void __attribute__((noinline)) func3() { sink(); /* tail */ }
20 void __attribute__((disable_tail_calls, noinline)) func2() { func3(); /* regular */ }
22 void __attribute__((noinline)) func1() { func2(); /* tail */ }
24 int __attribute__((disable_tail_calls)) main() {
25 func1(); /* regular */