[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / swift-async-extended-fp.c
blob79e0b63d773c67ec56054fd81d5f683aec5f6a88
1 // RUN: %clang_cc1 -mframe-pointer=all -triple x86_64-apple-darwin10 -target-cpu core2 -S -o - %s | FileCheck %s --check-prefix=ALWAYS-X86
2 // RUN: %clang_cc1 -mframe-pointer=all -triple x86_64-apple-darwin12 -target-cpu core2 -S -o - %s | FileCheck %s --check-prefix=ALWAYS-X86
3 // RUN: %clang_cc1 -fswift-async-fp=never -mframe-pointer=all -triple x86_64-apple-darwin10 -target-cpu core2 -S -o - %s | FileCheck %s --check-prefix=NEVER-X86
4 // RUN: %clang_cc1 -fswift-async-fp=never -mframe-pointer=all -triple x86_64-apple-darwin12 -target-cpu core2 -S -o - %s | FileCheck %s --check-prefix=NEVER-X86
5 // RUN: %clang_cc1 -fswift-async-fp=auto -mframe-pointer=all -triple x86_64-apple-darwin10 -target-cpu core2 -S -o - %s | FileCheck %s --check-prefix=AUTO-X86
6 // RUN: %clang_cc1 -fswift-async-fp=auto -mframe-pointer=all -triple x86_64-apple-darwin12 -target-cpu core2 -S -o - %s | FileCheck %s --check-prefix=ALWAYS-X86
7 // RUN: %clang_cc1 -fswift-async-fp=always -mframe-pointer=all -triple x86_64-apple-darwin10 -target-cpu core2 -S -o - %s | FileCheck %s --check-prefix=ALWAYS-X86
8 // RUN: %clang_cc1 -fswift-async-fp=always -mframe-pointer=all -triple x86_64-apple-darwin12 -target-cpu core2 -S -o - %s | FileCheck %s --check-prefix=ALWAYS-X86
10 // RUN: %clang_cc1 -mframe-pointer=all -triple arm64-apple-ios9 -target-cpu cyclone -S -o - %s | FileCheck %s --check-prefix=ALWAYS-ARM64
11 // RUN: %clang_cc1 -mframe-pointer=all -triple arm64-apple-ios15 -target-cpu cyclone -S -o - %s | FileCheck %s --check-prefix=ALWAYS-ARM64
12 // RUN: %clang_cc1 -fswift-async-fp=auto -mframe-pointer=all -triple arm64-apple-ios9 -target-cpu cyclone -S -o - %s | FileCheck %s --check-prefix=AUTO-ARM64
13 // RUN: %clang_cc1 -fswift-async-fp=auto -mframe-pointer=all -triple arm64-apple-ios15 -target-cpu cyclone -S -o - %s | FileCheck %s --check-prefix=ALWAYS-ARM64
14 // RUN: %clang_cc1 -fswift-async-fp=never -mframe-pointer=all -triple arm64-apple-ios9 -target-cpu cyclone -S -o - %s | FileCheck %s --check-prefix=NEVER-ARM64
15 // RUN: %clang_cc1 -fswift-async-fp=never -mframe-pointer=all -triple arm64-apple-ios15 -target-cpu cyclone -S -o - %s | FileCheck %s --check-prefix=NEVER-ARM64
16 // RUN: %clang_cc1 -fswift-async-fp=always -mframe-pointer=all -triple arm64-apple-ios9 -target-cpu cyclone -S -o - %s | FileCheck %s --check-prefix=ALWAYS-ARM64
17 // RUN: %clang_cc1 -fswift-async-fp=always -mframe-pointer=all -triple arm64-apple-ios15 -target-cpu cyclone -S -o - %s | FileCheck %s --check-prefix=ALWAYS-ARM64
19 // REQUIRES: aarch64-registered-target,x86-registered-target
21 #define SWIFTASYNCCALL __attribute__((swiftasynccall))
22 #define ASYNC_CONTEXT __attribute__((swift_async_context))
24 SWIFTASYNCCALL void async_context_1(ASYNC_CONTEXT void *ctx) {}
26 // AUTO-X86: _async_context_1:
27 // AUTO-X86: _swift_async_extendedFramePointerFlags
29 // ALWAYS-X86: _async_context_1:
30 // ALWAYS-X86: btsq $60
32 // NEVER-X86: _async_context_1:
33 // NEVER-X86-NOT: _swift_async_extendedFramePointerFlags
34 // NEVER-X86-NOT: btsq $60
36 // AUTO-ARM64: _async_context_1
37 // AUTO-ARM64: _swift_async_extendedFramePointerFlags
39 // ALWAYS-ARM64: _async_context_1
40 // ALWAYS-ARM64: orr x29, x29, #0x1000000000000000
42 // NEVER-ARM64: _async_context_1:
43 // NEVER-ARM64-NOT: _swift_async_extendedFramePointerFlags
44 // NEVER-ARM64-NOT: orr x29, x29, #0x1000000000000000