Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / attr-used-member-function-implicit-instantiation.cpp
blob64f5d50c7318e41d63de151c6799d96c522f3ed3
1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
3 // Check that PR17480 is fixed: __attribute__((used)) ignored in templated
4 // classes
5 namespace InstantiateUsedMemberDefinition {
6 template <typename T>
7 struct S {
8 int __attribute__((used)) f() {
9 return 0;
13 void test() {
14 // Check that InstantiateUsedMemberDefinition::S<int>::f() is defined
15 // as a result of the S class template implicit instantiation
16 // CHECK: define linkonce_odr noundef i32 @_ZN31InstantiateUsedMemberDefinition1SIiE1fEv
17 S<int> inst;
19 } // namespace InstantiateUsedMemberDefinition