Skip to content

Commit 6afdfd0

Browse files
committed
[clang] Add fp128 ABI tests for MinGW (NFC)
Add a test based on `win64-i128.c` with the current behavior of `__float128`.
1 parent 9b514bc commit 6afdfd0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

clang/test/CodeGen/win-fp128.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %clang_cc1 -triple x86_64-windows-gnu -emit-llvm -o - %s \
2+
// RUN: | FileCheck %s --check-prefix=CHECK-GNU64
3+
// __float128 is unsupported on MSVC
4+
5+
__float128 fp128_ret(void) { return 0; }
6+
// CHECK-GNU64: define dso_local fp128 @fp128_ret()
7+
8+
__float128 fp128_args(__float128 a, __float128 b) { return a * b; }
9+
// CHECK-GNU64: define dso_local fp128 @fp128_args(fp128 noundef %a, fp128 noundef %b)
10+
11+
void fp128_vararg(int a, ...) {
12+
// CHECK-GNU64-LABEL: define dso_local void @fp128_vararg
13+
__builtin_va_list ap;
14+
__builtin_va_start(ap, a);
15+
__float128 i = __builtin_va_arg(ap, __float128);
16+
// CHECK-GNU64: load ptr, ptr
17+
// CHECK-GNU64: load fp128, ptr
18+
__builtin_va_end(ap);
19+
}

0 commit comments

Comments
 (0)