Home | History | Annotate | Download | only in CodeGenCXX
      1 // REQUIRES: x86-registered-target
      2 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O1 -fmerge-functions -emit-llvm -o - -x c++ < %s | FileCheck %s
      3 
      4 // Basic functionality test. Function merging doesn't kick in on functions that
      5 // are too simple.
      6 
      7 struct A {
      8   virtual int f(int x, int *p) { return x ? *p : 1; }
      9   virtual int g(int x, int *p) { return x ? *p : 1; }
     10 } a;
     11 
     12 // CHECK: define {{.*}} @_ZN1A1gEiPi
     13 // CHECK-NEXT: tail call i32 @_ZN1A1fEiPi
     14 // CHECK-NEXT: ret
     15