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("bt", "main.cpp", "-implicit-check-not=artificial")
13 // CHECK: frame #0: 0x{{[0-9a-f]+}} a.out`sink() at main.cpp:[[@LINE-1]]:4 [opt]
14 // CHECK-NEXT: func2{{.*}} [opt] [artificial]
15 // CHECK-NEXT: main{{.*}} [opt]
18 void __attribute__((noinline)) func2() {
22 void __attribute__((noinline)) func1() { sink(); /* tail */ }
24 int __attribute__((disable_tail_calls)) main(int argc, char **) {
25 // The sequences `main -> f{1,2} -> sink` are both plausible. Test that
26 // return-pc call site info allows lldb to pick the correct sequence.