xref: /llvm-project/clang/test/CodeGenCXX/msabi-preserve-none-cc.cpp (revision 5dcf3d5335a8bd936c89a4cdf1da909e6b995b6f)
1 // RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -fdeclspec -emit-llvm %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -triple aarch64-unknown-windows-msvc -fdeclspec -emit-llvm %s -o - | FileCheck %s
3 
f()4 void __attribute__((__preserve_none__)) f() {}
5 // CHECK-DAG: @"?f@@YVXXZ"
6 
7 void (__attribute__((__preserve_none__)) *p)();
8 // CHECK-DAG: @"?p@@3P6VXXZEA
9 
10 namespace {
f()11 void __attribute__((__preserve_none__)) __attribute__((__used__)) f() { }
12 }
13 // CHECK-DAG: @"?f@?A0x{{[^@]*}}@@YVXXZ"
14 
15 namespace n {
f()16 void __attribute__((__preserve_none__)) f() {}
17 }
18 // CHECK-DAG: @"?f@n@@YVXXZ"
19 
20 struct __declspec(dllexport) S {
21   S(const S &) = delete;
22   S & operator=(const S &) = delete;
mS23   void __attribute__((__preserve_none__)) m() { }
24 };
25 // CHECK-DAG: @"?m@S@@QEAVXXZ"
26 
f(void (()))27 void f(void (__attribute__((__preserve_none__))())) {}
28 // CHECK-DAG: @"?f@@YAXP6VXXZ@Z"
29