xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/merge-functions.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // REQUIRES: x86-registered-target
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O1 -fmerge-functions -emit-llvm -o - -x c++ < %s | FileCheck %s
3*0a6a1f1dSLionel Sambuc 
4*0a6a1f1dSLionel Sambuc // Basic functionality test. Function merging doesn't kick in on functions that
5*0a6a1f1dSLionel Sambuc // are too simple.
6*0a6a1f1dSLionel Sambuc 
7*0a6a1f1dSLionel Sambuc struct A {
fA8*0a6a1f1dSLionel Sambuc   virtual int f(int x, int *p) { return x ? *p : 1; }
gA9*0a6a1f1dSLionel Sambuc   virtual int g(int x, int *p) { return x ? *p : 1; }
10*0a6a1f1dSLionel Sambuc } a;
11*0a6a1f1dSLionel Sambuc 
12*0a6a1f1dSLionel Sambuc // CHECK: define {{.*}} @_ZN1A1gEiPi
13*0a6a1f1dSLionel Sambuc // CHECK-NEXT: tail call i32 @_ZN1A1fEiPi
14*0a6a1f1dSLionel Sambuc // CHECK-NEXT: ret
15