File tree 3 files changed +25
-5
lines changed 3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -1915,8 +1915,15 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const {
1915
1915
Align = Target->getDoubleAlign();
1916
1916
break;
1917
1917
case BuiltinType::LongDouble:
1918
- Width = Target->getLongDoubleWidth();
1919
- Align = Target->getLongDoubleAlign();
1918
+ if (getLangOpts().OpenMP && getLangOpts().OpenMPIsDevice &&
1919
+ (Target->getLongDoubleWidth() != AuxTarget->getLongDoubleWidth() ||
1920
+ Target->getLongDoubleAlign() != AuxTarget->getLongDoubleAlign())) {
1921
+ Width = AuxTarget->getLongDoubleWidth();
1922
+ Align = AuxTarget->getLongDoubleAlign();
1923
+ } else {
1924
+ Width = Target->getLongDoubleWidth();
1925
+ Align = Target->getLongDoubleAlign();
1926
+ }
1920
1927
break;
1921
1928
case BuiltinType::Float128:
1922
1929
if (Target->hasFloat128Type() || !getLangOpts().OpenMP ||
Original file line number Diff line number Diff line change @@ -1576,7 +1576,9 @@ void Sema::checkOpenMPDeviceExpr(const Expr *E) {
1576
1576
"OpenMP device compilation mode is expected.");
1577
1577
QualType Ty = E->getType();
1578
1578
if ((Ty->isFloat16Type() && !Context.getTargetInfo().hasFloat16Type()) ||
1579
- (Ty->isFloat128Type() && !Context.getTargetInfo().hasFloat128Type()) ||
1579
+ ((Ty->isFloat128Type() ||
1580
+ (Ty->isRealFloatingType() && Context.getTypeSize(Ty) == 128)) &&
1581
+ !Context.getTargetInfo().hasFloat128Type()) ||
1580
1582
(Ty->isIntegerType() && Context.getTypeSize(Ty) == 128 &&
1581
1583
!Context.getTargetInfo().hasInt128Type()))
1582
1584
targetDiag(E->getExprLoc(), diag::err_type_unsupported)
Original file line number Diff line number Diff line change 1
1
// Test target codegen - host bc file has to be created first.
2
2
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-linux -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-host.bc
3
- // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -fsyntax-only
3
+ // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple x86_64-unknown-linux -fopenmp-targets=nvptx64-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -fsyntax-only
4
+ // RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-linux-gnu -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-host.bc
5
+ // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-linux-gnu -fopenmp-targets=nvptx64-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -fsyntax-only
4
6
5
7
struct T {
6
8
char a;
9
+ #ifndef _ARCH_PPC
7
10
__float128 f;
11
+ #else
12
+ long double f;
13
+ #endif
8
14
char c;
9
15
T () : a(12 ), f(15 ) {}
10
- T &operator +(T &b) { f += b.a ; return *this ;} // expected-error {{'__float128' is not supported on this target}}
16
+ #ifndef _ARCH_PPC
17
+ // expected-error@+4 {{'__float128' is not supported on this target}}
18
+ #else
19
+ // expected-error@+2 {{'long double' is not supported on this target}}
20
+ #endif
21
+ T &operator +(T &b) { f += b.a ; return *this ;}
11
22
};
12
23
13
24
struct T1 {
You can’t perform that action at this time.
0 commit comments