[InstCombine] Preserve NSW flags for `lshr (mul nuw X, C1), C2 -> mul nuw nsw X,...
[llvm-project.git] / clang / test / CodeGenCXX / mangle-ms-exception-spec.cpp
blob1aaf2486ea1415c53ec401585033a3d10727dc6c
1 // RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=x86_64-pc-win32 -Wno-noexcept-type -fms-compatibility-version=19.12 | FileCheck %s --check-prefix=CHECK --check-prefix=CXX11
2 // RUN: %clang_cc1 -std=c++17 -fms-extensions -emit-llvm %s -o - -triple=x86_64-pc-win32 | FileCheck %s --check-prefix=CHECK --check-prefix=NOCOMPAT
3 // RUN: %clang_cc1 -std=c++17 -fms-extensions -emit-llvm %s -o - -triple=x86_64-pc-win32 -fms-compatibility-version=19.12 | FileCheck %s --check-prefix=CHECK --check-prefix=CXX17
5 // Prove that mangling only changed for noexcept types under /std:C++17, not all noexcept functions
6 // CHECK-DAG: @"?nochange@@YAXXZ"
7 void nochange() noexcept {}
9 // CXX11-DAG: @"?a@@YAXP6AHXZ@Z"
10 // NOCOMPAT-DAG: @"?a@@YAXP6AHXZ@Z"
11 // CXX17-DAG: @"?a@@YAXP6AHX_E@Z"
12 void a(int() noexcept) {}
13 // CHECK-DAG: @"?b@@YAXP6AHXZ@Z"
14 void b(int() noexcept(false)) {}
15 // CXX11-DAG: @"?c@@YAXP6AHXZ@Z"
16 // NOCOMPAT-DAG: @"?c@@YAXP6AHXZ@Z"
17 // CXX17-DAG: @"?c@@YAXP6AHX_E@Z"
18 void c(int() noexcept(true)) {}
19 // CHECK-DAG: @"?d@@YAXP6AHXZ@Z"
20 void d(int()) {}
22 template <typename T>
23 class e;
24 template <typename T, typename... U>
25 class e<T(U...) noexcept> {
26 // CXX11-DAG: @"?ee@?$e@$$A6AXXZ@@EEAAXXZ"
27 // NOCOMPAT-DAG: @"?ee@?$e@$$A6AXXZ@@EEAAXXZ"
28 // CXX17-DAG: @"?ee@?$e@$$A6AXX_E@@EEAAXXZ"
29 virtual T ee(U &&...) noexcept {};
32 e<void() noexcept> e1;
34 template <typename T>
35 class f;
36 template <typename T, typename... U>
37 class f<T(U...)> {
38 // CHECK-DAG: @"?ff@?$f@$$A6AXXZ@@EEAAXXZ"
39 virtual T ff(U &&...) noexcept {};
42 f<void()> f1;