48 lines · cpp
1// RUN: %clang_cc1 -triple powerpc64-linux-musl -emit-llvm -o - %s | \2// RUN: FileCheck --check-prefix=FP64 %s3// RUN: %clang_cc1 -triple powerpc64-linux-gnu -emit-llvm -o - %s -mlong-double-64 | \4// RUN: FileCheck --check-prefix=FP64 %s5 6// musl defaults to -mlong-double-64, so -mlong-double-128 is needed to make7// -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 %s10// RUN: %clang_cc1 -triple powerpc64-linux-gnu -emit-llvm -o - %s \11// RUN: -mabi=ieeelongdouble | FileCheck --check-prefix=FP128 %s12 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 %s16// RUN: %clang_cc1 -triple powerpc64-linux-musl -emit-llvm -o - -mlong-double-128 %s | \17// RUN: FileCheck --check-prefix=IBM128 %s18 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 %s22// RUN: %clang -E -dM -ffreestanding -target powerpc64le-linux-gnu %s \23// RUN: -mabi=ieeelongdouble | FileCheck -check-prefix=CHECK-DEF-IEEE128 %s24// RUN: %clang -E -dM -ffreestanding -target powerpc64le-linux-gnu %s \25// RUN: -mlong-double-64 | FileCheck -check-prefix=CHECK-DEF-F64 %s26 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 33long double x = 0;34int size = sizeof(x);35 36// FP64: @x ={{.*}} global double {{.*}}, align 837// FP64: @size ={{.*}} global i32 838// FP128: @x ={{.*}} global fp128 {{.*}}, align 1639// FP128: @size ={{.*}} global i32 1640// IBM128: @x ={{.*}} global ppc_fp128 {{.*}}, align 1641// IBM128: @size ={{.*}} global i32 1642 43long 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