diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
commit | 06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 (patch) | |
tree | 3eb853da77d46cc77c4b017525a422f9ddb1385b /test/CodeGenCXX/merge-functions.cpp | |
parent | 30d791273d07fac9c0c1641a0731191bca6e8606 (diff) |
Notes
Diffstat (limited to 'test/CodeGenCXX/merge-functions.cpp')
-rw-r--r-- | test/CodeGenCXX/merge-functions.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGenCXX/merge-functions.cpp b/test/CodeGenCXX/merge-functions.cpp new file mode 100644 index 000000000000..2137f19c409c --- /dev/null +++ b/test/CodeGenCXX/merge-functions.cpp @@ -0,0 +1,14 @@ +// 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 |