Skip to content

Commit 77987b3

Browse files
committed
[Clang] fix for heterogeneous chip's host side's MaybeODRUseExprs clear
1 parent 09ff631 commit 77987b3

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

clang/lib/Sema/SemaStmtAsm.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
273273
Expr *asmString, MultiExprArg clobbers,
274274
unsigned NumLabels,
275275
SourceLocation RParenLoc) {
276+
struct _Cleaner {
277+
Sema &S;
278+
~_Cleaner() {
279+
S.DiscardCleanupsInEvaluationContext();
280+
}
281+
} _C{*this};
276282
unsigned NumClobbers = clobbers.size();
277283

278284
SmallVector<TargetInfo::ConstraintInfo, 4> OutputConstraintInfos;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// REQUIRES: nvptx-registered-target
2+
// REQUIRES: x86-registered-target
3+
4+
// RUN: %clang_cc1 "-triple" "x86_64-unknown-linux-gnu" "-aux-triple" "nvptx64-nvidia-cuda" \
5+
// RUN: "-target-cpu" "x86-64" "-fsyntax-only" %s
6+
7+
#include "Inputs/cuda.h"
8+
9+
typedef __attribute__((ext_vector_type(16))) float float32x16_t;
10+
__device__ void test(float32x16_t& vodd) {
11+
constexpr int pose = 16;
12+
__asm__ __volatile__("vadd %0, %1, %2":"=&v"(vodd):"r"(pose),"v"(vodd));
13+
}

0 commit comments

Comments
 (0)