1 // RUN: %clang_cc1 -triple powerpc64-linux-musl -emit-llvm -o - %s | \ 2 // RUN: FileCheck --check-prefix=FP64 %s 3 // RUN: %clang_cc1 -triple powerpc64-linux-gnu -emit-llvm -o - %s -mlong-double-64 | \ 4 // RUN: FileCheck --check-prefix=FP64 %s 5 6 // musl defaults to -mlong-double-64, so -mlong-double-128 is needed to make 7 // -mabi=ieeelongdouble effective. 8 // RUN: %clang_cc1 -triple powerpc64-linux-musl -emit-llvm -o - %s -mlong-double-128 \ 9 // RUN: -mabi=ieeelongdouble | FileCheck --check-prefix=FP128 %s 10 // RUN: %clang_cc1 -triple powerpc64-linux-gnu -emit-llvm -o - %s \ 11 // RUN: -mabi=ieeelongdouble | FileCheck --check-prefix=FP128 %s 12 13 // IBM extended double is the default. 14 // RUN: %clang_cc1 -triple powerpc64-linux-gnu -emit-llvm -o - %s | \ 15 // RUN: FileCheck --check-prefix=IBM128 %s 16 // RUN: %clang_cc1 -triple powerpc64-linux-musl -emit-llvm -o - -mlong-double-128 %s | \ 17 // RUN: FileCheck --check-prefix=IBM128 %s 18 19 // Check IBM-quad and IEEE-quad macros are defined. 20 // RUN: %clang -E -dM -ffreestanding -target powerpc64le-linux-gnu %s \ 21 // RUN: -mabi=ibmlongdouble | FileCheck -check-prefix=CHECK-DEF-IBM128 %s 22 // RUN: %clang -E -dM -ffreestanding -target powerpc64le-linux-gnu %s \ 23 // RUN: -mabi=ieeelongdouble | FileCheck -check-prefix=CHECK-DEF-IEEE128 %s 24 // RUN: %clang -E -dM -ffreestanding -target powerpc64le-linux-gnu %s \ 25 // RUN: -mlong-double-64 | FileCheck -check-prefix=CHECK-DEF-F64 %s 26 27 // CHECK-DEF-IBM128: #define __LONG_DOUBLE_128__ 28 // CHECK-DEF-IBM128: #define __LONG_DOUBLE_IBM128__ 29 // CHECK-DEF-IEEE128: #define __LONG_DOUBLE_128__ 30 // CHECK-DEF-IEEE128: #define __LONG_DOUBLE_IEEE128__ 31 // CHECK-DEF-F64-NOT: #define __LONG_DOUBLE_128__ 32 33 long double x = 0; 34 int size = sizeof(x); 35 36 // FP64: @x ={{.*}} global double {{.*}}, align 8 37 // FP64: @size ={{.*}} global i32 8 38 // FP128: @x ={{.*}} global fp128 {{.*}}, align 16 39 // FP128: @size ={{.*}} global i32 16 40 // IBM128: @x ={{.*}} global ppc_fp128 {{.*}}, align 16 41 // IBM128: @size ={{.*}} global i32 16 42 43 long double foo(long double d) { return d; } 44 45 // FP64: double @_Z3fooe(double noundef %d) 46 // FP128: fp128 @_Z3foou9__ieee128(fp128 noundef %d) 47 // IBM128: ppc_fp128 @_Z3foog(ppc_fp128 noundef %d) 48