You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
471 B

// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O1 -fmerge-functions -emit-llvm -o - -x c++ < %s | FileCheck %s
// Basic functionality test. Function merging doesn't kick in on functions that
// are too simple.
struct A {
virtual int f(int x, int *p) { return x ? *p : 1; }
virtual int g(int x, int *p) { return x ? *p : 1; }
} a;
// CHECK: define {{.*}} @_ZN1A1gEiPi
// CHECK-NEXT: tail call i32 @_ZN1A1fEiPi
// CHECK-NEXT: ret