1fda59e58SRichard Smith // RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s --check-prefix CHECK --check-prefix CHECK-CXX11 2fda59e58SRichard Smith // RUN: %clang_cc1 -std=c++1z -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s --check-prefix CHECK --check-prefix CHECK-CXX17 3fda59e58SRichard Smith 4fda59e58SRichard Smith // CHECK: define {{.*}} @_Z1aPFivE( 5fda59e58SRichard Smith void a(int() throw(int, float)) {} 6fda59e58SRichard Smith // CHECK-CXX11: define {{.*}} @_Z1bPFivE( 7*ef09aa90SRichard Smith // CHECK-CXX17: define {{.*}} @_Z1bPDoFivE( 8fda59e58SRichard Smith void b(int() noexcept) {} 9fda59e58SRichard Smith // CHECK-CXX11: define {{.*}} @_Z1cPFivE( 10*ef09aa90SRichard Smith // CHECK-CXX17: define {{.*}} @_Z1cPDoFivE( 11fda59e58SRichard Smith void c(int() throw()) {} 12fda59e58SRichard Smith // CHECK: define {{.*}} @_Z1dPFivE( 13fda59e58SRichard Smith void d(int() noexcept(false)) {} 14fda59e58SRichard Smith // CHECK-CXX11: define {{.*}} @_Z1ePFivE( 15*ef09aa90SRichard Smith // CHECK-CXX17: define {{.*}} @_Z1ePDoFivE( 16fda59e58SRichard Smith void e(int() noexcept(true)) {} 17fda59e58SRichard Smith 18fda59e58SRichard Smith template<bool B> void f(int() noexcept(B)) {} 19*ef09aa90SRichard Smith // CHECK: define {{.*}} @_Z1fILb0EEvPDOT_EFivE( 20fda59e58SRichard Smith template void f<false>(int()); 21*ef09aa90SRichard Smith // CHECK: define {{.*}} @_Z1fILb1EEvPDOT_EFivE( 22fda59e58SRichard Smith template void f<true>(int() noexcept); 23fda59e58SRichard Smith 24fda59e58SRichard Smith template<typename...T> void g(int() throw(T...)) {} 25*ef09aa90SRichard Smith // CHECK: define {{.*}} @_Z1gIJEEvPDwDpT_EFivE( 26fda59e58SRichard Smith template void g<>(int() noexcept); 27*ef09aa90SRichard Smith // CHECK: define {{.*}} @_Z1gIJfEEvPDwDpT_EFivE( 28fda59e58SRichard Smith template void g<float>(int()); 29fda59e58SRichard Smith 30fda59e58SRichard Smith // We consider the exception specifications in parameter and return type here 31fda59e58SRichard Smith // to be different. 32fda59e58SRichard Smith template<typename...T> auto h(int() throw(int, T...)) -> int (*)() throw(T..., int) { return nullptr; } 33*ef09aa90SRichard Smith // CHECK: define {{.*}} @_Z1hIJEEPDwDpT_iEFivEPDwiS1_EFivE( 34fda59e58SRichard Smith template auto h<>(int()) -> int (*)(); 35*ef09aa90SRichard Smith // CHECK: define {{.*}} @_Z1hIJfEEPDwDpT_iEFivEPDwiS1_EFivE( 36fda59e58SRichard Smith template auto h<float>(int()) -> int (*)(); 37fda59e58SRichard Smith 38fda59e58SRichard Smith // FIXME: The C++11 manglings here are wrong; they should be the same as the 39fda59e58SRichard Smith // C++17 manglings. 40fda59e58SRichard Smith // The mangler mishandles substitutions for instantiation-dependent types that 41fda59e58SRichard Smith // differ only in type sugar that is not relevant for mangling. (In this case, 42fda59e58SRichard Smith // the types differ in presence/absence of ParenType nodes under the pointer.) 43fda59e58SRichard Smith template<typename...T> auto i(int() throw(int, T...)) -> int (*)() throw(int, T...) { return nullptr; } 44*ef09aa90SRichard Smith // CHECK-CXX11: define {{.*}} @_Z1iIJEEPDwiDpT_EFivEPS2_( 45*ef09aa90SRichard Smith // CHECK-CXX17: define {{.*}} @_Z1iIJEEPDwiDpT_EFivES3_( 46fda59e58SRichard Smith template auto i<>(int()) -> int (*)(); 47*ef09aa90SRichard Smith // CHECK-CXX11: define {{.*}} @_Z1iIJfEEPDwiDpT_EFivEPS2_( 48*ef09aa90SRichard Smith // CHECK-CXX17: define {{.*}} @_Z1iIJfEEPDwiDpT_EFivES3_( 49fda59e58SRichard Smith template auto i<float>(int()) -> int (*)(); 50