brintos

brintos / llvm-project-archived public Read only

0
0
Text · 609 B · 64f5d50 Raw
20 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s2 3// Check that PR17480 is fixed: __attribute__((used)) ignored in templated4// classes5namespace InstantiateUsedMemberDefinition {6template <typename T>7struct S {8  int __attribute__((used)) f() {9    return 0;10  }11};12 13void test() {14  // Check that InstantiateUsedMemberDefinition::S<int>::f() is defined15  // as a result of the S class template implicit instantiation16  // CHECK: define linkonce_odr noundef i32 @_ZN31InstantiateUsedMemberDefinition1SIiE1fEv17  S<int> inst;18}19} // namespace InstantiateUsedMemberDefinition20