brintos

brintos / llvm-project-archived public Read only

0
0
Text · 674 B · d3afd80 Raw
18 lines · cpp
1// REQUIRES: x86-registered-target2// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O0 -fmerge-functions -emit-llvm -o - -x c++ < %s | FileCheck %s3// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O1 -fmerge-functions -emit-llvm -o - -x c++ < %s | FileCheck %s4 5// Basic functionality test. Function merging doesn't kick in on functions that6// are too simple.7 8struct A {9  virtual int f(int x, int *p) { return x ? *p : 1; }10  virtual int g(int x, int *p) { return x ? *p : 1; }11} a;12 13// CHECK: define linkonce_odr noundef i32 @_ZN1A1gEiPi(14// CHECK:   tail call noundef i32 @0(15 16// CHECK: define linkonce_odr noundef i32 @_ZN1A1fEiPi(17// CHECK:   tail call noundef i32 @0(18