Skip to content

Commit 79d4e43

Browse files
committed
tests/driver/ppc_float_abi.d: add a test to test ppc64 real type
ABI switching
1 parent 9bcee7c commit 79d4e43

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/driver/ppc_float_abi.d

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// REQUIRES: target_PowerPC
2+
3+
// RUN: %ldc -c -output-ll -of=%t.ll %s -mtriple=powerpc64le-linux-gnu -mabi=ieeelongdouble && FileCheck %s --check-prefix=CHECK-GNU-IEEE < %t.ll
4+
// RUN: %ldc -c -output-ll -of=%t.ll %s -mtriple=powerpc64le-linux-gnu && FileCheck %s --check-prefix=CHECK-IBM-LDBL < %t.ll
5+
// the following is an invalid configuration: Musl does not support IEEE quad fp on powerpc
6+
// RUN: %ldc -c -output-ll -of=%t.ll %s -mtriple=powerpc64le-linux-musl -mabi=ieeelongdouble && FileCheck %s --check-prefix=CHECK-MUSL < %t.ll
7+
8+
// CHECK-GNU-IEEE-LABEL: @_Z13test_functionu9__ieee128
9+
// CHECK-IBM-LDBL-LABEL: @_Z13test_functiong
10+
// CHECK-MUSL-LABEL: @_Z13test_functione
11+
extern (C++) bool test_function(real arg) {
12+
// CHECK-GNU-IEEE: fcmp ogt fp128 {{.*}}, 0xL00000000000000000000000000000000
13+
// CHECK-IBM-LDBL: fcmp ogt ppc_fp128 {{.*}}, 0xM00000000000000000000000000000000
14+
// CHECK-MUSL: fcmp ogt double {{.*}}, 0.000000e+00
15+
return arg > 0.0;
16+
}
17+
18+
// CHECK-GNU-IEEE: !{i32 1, !"float-abi", !"ieeequad"}
19+
// CHECK-IBM-LDBL: !{i32 1, !"float-abi", !"doubledouble"}

0 commit comments

Comments
 (0)