Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / auto-variable-template.cpp
blobff8f898697a87dd3df463066e2aaeddcacf06051
1 // RUN: %clang_cc1 -std=c++14 %s -triple=x86_64-linux -emit-llvm -o - | FileCheck %s
3 struct f {
4 void operator()() const {}
5 };
7 template <typename T> auto vtemplate = f{};
9 int main() { vtemplate<int>(); }
11 // CHECK: @_Z9vtemplateIiE = linkonce_odr global %struct.f undef, comdat
13 // CHECK: define{{.*}} i32 @main()
14 // CHECK: call void @_ZNK1fclEv(ptr {{[^,]*}} @_Z9vtemplateIiE)
16 template <typename>
17 struct pack {
18 template <typename T>
19 constexpr static auto some_boolean_cx_value = true;
22 auto usage() {
23 return pack<char>::some_boolean_cx_value<int>;
26 // CHECK: define{{.*}} i1 @_Z5usagev()
28 auto otherusage() {
29 return pack<char>{}.some_boolean_cx_value<int>;
32 // CHECK: define{{.*}} i1 @_Z10otherusagev()