This is part of the efforts adding .gnu_attribute support for PowerPC. In Clang, an extra metadata field will be added as float-abi to show current long double format. So backend can emit .gnu_attribute section data from this metadata. To avoid breaking existing behavior, the module metadata will only be emitted when this module makes use of long double. Reviewed By: nemanjai Differential Revision: https://reviews.llvm.org/D116016
18 lines
807 B
C
18 lines
807 B
C
// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu %s -emit-llvm -o - | FileCheck %s
|
|
// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu %s -emit-llvm -mabi=ieeelongdouble -o - | FileCheck %s --check-prefix=IEEE
|
|
// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu %s -emit-llvm -mlong-double-64 -o - | FileCheck %s --check-prefix=LDBL64
|
|
// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu %s -emit-llvm -DNOLDBL -o - | FileCheck %s --check-prefix=NOLDBL
|
|
|
|
#ifndef NOLDBL
|
|
long double foo(long double a, long double b) {
|
|
return a + b;
|
|
}
|
|
#endif
|
|
|
|
int bar() { return 1; }
|
|
|
|
// CHECK: ![[#]] = !{i32 1, !"float-abi", !"doubledouble"}
|
|
// IEEE: ![[#]] = !{i32 1, !"float-abi", !"ieeequad"}
|
|
// LDBL64: ![[#]] = !{i32 1, !"float-abi", !"ieeedouble"}
|
|
// NOLDBL-NOT: ![[#]] = !{i32 1, !"float-abi"
|