brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · b124644 Raw
37 lines · cpp
1// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm -w -o - | FileCheck %s2 3struct S {4  enum { FOO = 42 };5  enum { BAR = 42 };6};7 8template <typename T> struct X {9  T value;10  X(T t) : value(t) {}11  int f() { return value; }12};13 14template <typename T> int f(T t) {15  X<T> x(t);16  return x.f();17}18 19void test() {20  // Look for two instantiations, one for FOO's21  // type and one for BAR's.22  // CHECK-LABEL: define linkonce_odr noundef i32 @_Z1fIN1SUt_EEiT_(i32 noundef %t)23  (void)f(S::FOO);24  // CHECK-LABEL: define linkonce_odr noundef i32 @_Z1fIN1SUt0_EEiT_(i32 noundef %t)25  (void)f(S::BAR);26 27  // Now check for the class template instantiations.28  //29  // BAR's instantiation of X:30  // CHECK-LABEL: define linkonce_odr noundef i32 @_ZN1XIN1SUt_EE1fEv(ptr {{[^,]*}} %this)31  // CHECK-LABEL: define linkonce_odr void @_ZN1XIN1SUt_EEC2ES1_(ptr {{[^,]*}} %this, i32 noundef %t) unnamed_addr32  //33  // FOO's instantiation of X:34  // CHECK-LABEL: define linkonce_odr noundef i32 @_ZN1XIN1SUt0_EE1fEv(ptr {{[^,]*}} %this)35  // CHECK-LABEL: define linkonce_odr void @_ZN1XIN1SUt0_EEC2ES1_(ptr {{[^,]*}} %this, i32 noundef %t) unnamed_addr36}37