32 lines · cpp
1// RUN: %clang_cc1 -triple=x86_64-apple-darwin -std=c++11 -emit-llvm -o - %s | FileCheck %s2 3class Class1 {4public:5 [[clang::not_tail_called]] int m1();6 int m2();7 [[clang::not_tail_called]] virtual int m3();8 virtual int m4();9};10 11class Class2: public Class1 {12public:13 [[clang::not_tail_called]] int m4() override;14};15 16int foo1(int a, Class1 *c1, Class2 &c2) {17 if (a)18 return c1->m1();19 c1->m3();20 Class1 &c = c2;21 c.m4();22 c2.m4();23 return c1->m2();24}25 26// CHECK-LABEL: define{{.*}} i32 @_Z4foo1iP6Class1R6Class2(27// CHECK: %{{[a-z0-9]+}} = notail call noundef i32 @_ZN6Class12m1Ev(ptr28// CHECK: %{{[a-z0-9]+}} = notail call noundef i32 %{{[0-9]+}}(ptr29// CHECK-NOT: %{{[a-z0-9]+}} = notail call noundef i32 %{{[0-9]+}}(ptr30// CHECK: %{{[a-z0-9]+}} = notail call noundef i32 %{{[0-9]+}}(ptr 31// CHECK: %{{[a-z0-9]+}} = call noundef i32 @_ZN6Class12m2Ev(ptr32