// RUN: %clang_cc1 %s -triple %itanium_abi_triple -std=c++11 -disable-O0-optnone -emit-llvm -o - | FileCheck %s
// Test optnone on template instantiations.
//-- Effect of optnone on generic add template function.
T
T
// This function should cause instantiations of each template, one marked
// with the 'optnone' attribute.
int
// CHECK: @_Z15template_normalIiET_S0_({{.*}}) [[NORMAL:#[0-9]+]]
// CHECK: @_Z16template_optnoneIiET_S0_({{.*}}) [[OPTNONE:#[0-9]+]]
//-- Effect of optnone on a partial specialization.
// FIRST TEST: a method becomes marked with optnone in the specialization.
;
;
// This function should cause an instantiation of the full template (whose
// method is not marked optnone) and an instantiation of the partially
// specialized template (whose method is marked optnone).
void
// CHECK: @_ZN20template_normal_baseIfiE6methodEfi({{.*}}) [[NORMAL]]
// CHECK: @_ZN20template_normal_baseIifE6methodEif({{.*}}) [[OPTNONE]]
//-- Effect of optnone on a partial specialization.
// SECOND TEST: a method loses optnone in the specialization.
;
;
// This function should cause an instantiation of the full template (whose
// method is marked optnone) and an instantiation of the partially
// specialized template (whose method is not marked optnone).
void
// CHECK: @_ZN21template_optnone_baseIfiE6methodEfi({{.*}}) [[OPTNONE]]
// CHECK: @_ZN21template_optnone_baseIifE6methodEif({{.*}}) [[NORMAL]]
// CHECK: attributes [[NORMAL]] =
// CHECK-NOT: optnone
// CHECK: attributes [[OPTNONE]] = {{.*}} optnone