Skip to content

Commit 58920b6

Browse files
committed
Merge from 'main' to 'sycl-web' (#132)
CONFLICT (content): Merge conflict in clang/include/clang/Basic/DiagnosticDriverKinds.td
2 parents 2c106cc + 5ad038a commit 58920b6

File tree

431 files changed

+775851
-4212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

431 files changed

+775851
-4212
lines changed

clang/docs/ClangCommandLineReference.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,9 +1143,9 @@ Set directory to include search path with prefix
11431143

11441144
Add directory to SYSTEM include search path, absolute paths are relative to -isysroot
11451145

1146-
.. option:: --libomptarget-nvptx-path=<arg>
1146+
.. option:: --libomptarget-nvptx-bc-path=<arg>
11471147

1148-
Path to libomptarget-nvptx libraries
1148+
Path to libomptarget-nvptx bitcode library
11491149

11501150
.. option:: --ptxas-path=<arg>
11511151

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,14 @@ def err_drv_expecting_fsycl_with_sycl_opt : Error<
279279
"The option %0 must be used in conjunction with -fsycl to enable offloading.">;
280280
def err_drv_fsycl_with_c_type : Error<
281281
"The option '%0' must not be used in conjunction with '-fsycl', which expects C++ source.">;
282-
def warn_drv_omp_offload_target_duplicate : Warning<
283-
"The OpenMP offloading target '%0' is similar to target '%1' already specified - will be ignored.">,
284-
InGroup<OpenMPTarget>;
285282
def warn_drv_sycl_offload_target_duplicate : Warning<
286283
"The SYCL offloading target '%0' is similar to target '%1' already specified - will be ignored.">,
287284
InGroup<SyclTarget>;
288-
def warn_drv_omp_offload_target_missingbcruntime : Warning<
289-
"No library '%0' found in the default clang lib directory or in LIBRARY_PATH. Expect degraded performance due to no inlining of runtime functions on target devices.">,
285+
def err_drv_omp_offload_target_missingbcruntime : Error<
286+
"No library '%0' found in the default clang lib directory or in LIBRARY_PATH. Please use --libomptarget-nvptx-bc-path to specify nvptx bitcode library.">;
287+
def err_drv_omp_offload_target_bcruntime_not_found : Error<"Bitcode library '%0' does not exist.">;
288+
def warn_drv_omp_offload_target_duplicate : Warning<
289+
"The OpenMP offloading target '%0' is similar to target '%1' already specified - will be ignored.">,
290290
InGroup<OpenMPTarget>;
291291
def err_drv_unsupported_embed_bitcode
292292
: Error<"%0 is not supported with -fembed-bitcode">;

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,8 +1012,8 @@ def gpu_max_threads_per_block_EQ : Joined<["--"], "gpu-max-threads-per-block=">,
10121012
def gpu_instrument_lib_EQ : Joined<["--"], "gpu-instrument-lib=">,
10131013
HelpText<"Instrument device library for HIP, which is a LLVM bitcode containing "
10141014
"__cyg_profile_func_enter and __cyg_profile_func_exit">;
1015-
def libomptarget_nvptx_path_EQ : Joined<["--"], "libomptarget-nvptx-path=">, Group<i_Group>,
1016-
HelpText<"Path to libomptarget-nvptx libraries">;
1015+
def libomptarget_nvptx_bc_path_EQ : Joined<["--"], "libomptarget-nvptx-bc-path=">, Group<i_Group>,
1016+
HelpText<"Path to libomptarget-nvptx bitcode library">;
10171017
def dD : Flag<["-"], "dD">, Group<d_Group>, Flags<[CC1Option]>,
10181018
HelpText<"Print macro definitions in -E mode in addition to normal output">;
10191019
def dI : Flag<["-"], "dI">, Group<d_Group>, Flags<[CC1Option]>,

clang/lib/CodeGen/CGExprConstant.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ struct ConstantAggregateBuilderUtils {
5858
}
5959

6060
llvm::Constant *getPadding(CharUnits PadSize) const {
61-
llvm::Type *Ty = CGM.Int8Ty;
61+
llvm::Type *Ty = CGM.CharTy;
6262
if (PadSize > CharUnits::One())
6363
Ty = llvm::ArrayType::get(Ty, PadSize.getQuantity());
6464
return llvm::UndefValue::get(Ty);
6565
}
6666

6767
llvm::Constant *getZeroes(CharUnits ZeroSize) const {
68-
llvm::Type *Ty = llvm::ArrayType::get(CGM.Int8Ty, ZeroSize.getQuantity());
68+
llvm::Type *Ty = llvm::ArrayType::get(CGM.CharTy, ZeroSize.getQuantity());
6969
return llvm::ConstantAggregateZero::get(Ty);
7070
}
7171
};
@@ -1069,7 +1069,7 @@ class ConstExprEmitter :
10691069

10701070
assert(CurSize <= TotalSize && "Union size mismatch!");
10711071
if (unsigned NumPadBytes = TotalSize - CurSize) {
1072-
llvm::Type *Ty = CGM.Int8Ty;
1072+
llvm::Type *Ty = CGM.CharTy;
10731073
if (NumPadBytes > 1)
10741074
Ty = llvm::ArrayType::get(Ty, NumPadBytes);
10751075

clang/lib/CodeGen/CGRecordLayoutBuilder.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,20 @@ struct CGRecordLowering {
127127

128128
/// Wraps llvm::Type::getIntNTy with some implicit arguments.
129129
llvm::Type *getIntNType(uint64_t NumBits) {
130+
unsigned AlignedBits = llvm::alignTo(NumBits, Context.getCharWidth());
131+
return llvm::Type::getIntNTy(Types.getLLVMContext(), AlignedBits);
132+
}
133+
/// Get the LLVM type sized as one character unit.
134+
llvm::Type *getCharType() {
130135
return llvm::Type::getIntNTy(Types.getLLVMContext(),
131-
(unsigned)llvm::alignTo(NumBits, 8));
136+
Context.getCharWidth());
132137
}
133-
/// Gets an llvm type of size NumBytes and alignment 1.
134-
llvm::Type *getByteArrayType(CharUnits NumBytes) {
135-
assert(!NumBytes.isZero() && "Empty byte arrays aren't allowed.");
136-
llvm::Type *Type = llvm::Type::getInt8Ty(Types.getLLVMContext());
137-
return NumBytes == CharUnits::One() ? Type :
138-
(llvm::Type *)llvm::ArrayType::get(Type, NumBytes.getQuantity());
138+
/// Gets an llvm type of size NumChars and alignment 1.
139+
llvm::Type *getByteArrayType(CharUnits NumChars) {
140+
assert(!NumChars.isZero() && "Empty byte arrays aren't allowed.");
141+
llvm::Type *Type = getCharType();
142+
return NumChars == CharUnits::One() ? Type :
143+
(llvm::Type *)llvm::ArrayType::get(Type, NumChars.getQuantity());
139144
}
140145
/// Gets the storage type for a field decl and handles storage
141146
/// for itanium bitfields that are smaller than their declared type.

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ CodeGenModule::CodeGenModule(ASTContext &C, const HeaderSearchOptions &HSO,
124124
C.toCharUnitsFromBits(C.getTargetInfo().getMaxPointerWidth()).getQuantity();
125125
IntAlignInBytes =
126126
C.toCharUnitsFromBits(C.getTargetInfo().getIntAlign()).getQuantity();
127+
CharTy =
128+
llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getCharWidth());
127129
IntTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getIntWidth());
128130
IntPtrTy = llvm::IntegerType::get(LLVMContext,
129131
C.getTargetInfo().getMaxPointerWidth());

clang/lib/CodeGen/CodeGenTypeCache.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ struct CodeGenTypeCache {
4141
/// int
4242
llvm::IntegerType *IntTy;
4343

44+
/// char
45+
llvm::IntegerType *CharTy;
46+
4447
/// intptr_t, size_t, and ptrdiff_t, which we assume are the same size.
4548
union {
4649
llvm::IntegerType *IntPtrTy;

clang/lib/CodeGen/TargetInfo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4709,13 +4709,12 @@ Address PPC32_SVR4_ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAList,
47094709
// };
47104710

47114711
bool isI64 = Ty->isIntegerType() && getContext().getTypeSize(Ty) == 64;
4712-
bool isInt =
4713-
Ty->isIntegerType() || Ty->isPointerType() || Ty->isAggregateType();
4712+
bool isInt = !Ty->isFloatingType();
47144713
bool isF64 = Ty->isFloatingType() && getContext().getTypeSize(Ty) == 64;
47154714

47164715
// All aggregates are passed indirectly? That doesn't seem consistent
47174716
// with the argument-lowering code.
4718-
bool isIndirect = Ty->isAggregateType();
4717+
bool isIndirect = isAggregateTypeForABI(Ty);
47194718

47204719
CGBuilderTy &Builder = CGF.Builder;
47214720

clang/lib/Driver/ToolChains/Arch/RISCV.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ static StringRef getExtensionType(StringRef Ext) {
5858
// extension that the compiler currently supports.
5959
static Optional<RISCVExtensionVersion>
6060
isExperimentalExtension(StringRef Ext) {
61-
if (Ext == "b" || Ext == "zbb" || Ext == "zbc" || Ext == "zbe" ||
62-
Ext == "zbf" || Ext == "zbm" || Ext == "zbp" || Ext == "zbr" ||
63-
Ext == "zbs" || Ext == "zbt" || Ext == "zbproposedc")
64-
return RISCVExtensionVersion{"0", "92"};
61+
if (Ext == "b" || Ext == "zba" || Ext == "zbb" || Ext == "zbc" ||
62+
Ext == "zbe" || Ext == "zbf" || Ext == "zbm" || Ext == "zbp" ||
63+
Ext == "zbr" || Ext == "zbs" || Ext == "zbt" || Ext == "zbproposedc")
64+
return RISCVExtensionVersion{"0", "93"};
6565
if (Ext == "v")
6666
return RISCVExtensionVersion{"0", "9"};
6767
if (Ext == "zfh")

clang/lib/Driver/ToolChains/Cuda.cpp

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,6 @@ void NVPTX::OpenMPLinker::ConstructJob(Compilation &C, const JobAction &JA,
600600
CmdArgs.push_back("-arch");
601601
CmdArgs.push_back(Args.MakeArgString(GPUArch));
602602

603-
// Assume that the directory specified with --libomptarget_nvptx_path
604-
// contains the static library libomptarget-nvptx.a.
605-
if (const Arg *A = Args.getLastArg(options::OPT_libomptarget_nvptx_path_EQ))
606-
CmdArgs.push_back(Args.MakeArgString(Twine("-L") + A->getValue()));
607-
608603
// Add paths specified in LIBRARY_PATH environment variable as -L options.
609604
addDirectoryList(Args, CmdArgs, "-L", "LIBRARY_PATH");
610605

@@ -614,9 +609,6 @@ void NVPTX::OpenMPLinker::ConstructJob(Compilation &C, const JobAction &JA,
614609
llvm::sys::path::append(DefaultLibPath, "lib" CLANG_LIBDIR_SUFFIX);
615610
CmdArgs.push_back(Args.MakeArgString(Twine("-L") + DefaultLibPath));
616611

617-
// Add linking against library implementing OpenMP calls on NVPTX target.
618-
CmdArgs.push_back("-lomptarget-nvptx");
619-
620612
for (const auto &II : Inputs) {
621613
if (II.getType() == types::TY_LLVM_IR ||
622614
II.getType() == types::TY_LTO_IR ||
@@ -810,9 +802,6 @@ void CudaToolChain::addClangTargetOptions(
810802

811803
if (DeviceOffloadingKind == Action::OFK_OpenMP) {
812804
SmallVector<StringRef, 8> LibraryPaths;
813-
if (const Arg *A = DriverArgs.getLastArg(options::OPT_libomptarget_nvptx_path_EQ))
814-
LibraryPaths.push_back(A->getValue());
815-
816805
// Add user defined library paths from LIBRARY_PATH.
817806
llvm::Optional<std::string> LibPath =
818807
llvm::sys::Process::GetEnv("LIBRARY_PATH");
@@ -830,22 +819,37 @@ void CudaToolChain::addClangTargetOptions(
830819
llvm::sys::path::append(DefaultLibPath, Twine("lib") + CLANG_LIBDIR_SUFFIX);
831820
LibraryPaths.emplace_back(DefaultLibPath.c_str());
832821

833-
std::string LibOmpTargetName =
834-
"libomptarget-nvptx-" + GpuArch.str() + ".bc";
835-
bool FoundBCLibrary = false;
836-
for (StringRef LibraryPath : LibraryPaths) {
837-
SmallString<128> LibOmpTargetFile(LibraryPath);
838-
llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);
839-
if (llvm::sys::fs::exists(LibOmpTargetFile)) {
822+
// First check whether user specifies bc library
823+
if (const Arg *A =
824+
DriverArgs.getLastArg(options::OPT_libomptarget_nvptx_bc_path_EQ)) {
825+
std::string LibOmpTargetName(A->getValue());
826+
if (llvm::sys::fs::exists(LibOmpTargetName)) {
840827
CC1Args.push_back("-mlink-builtin-bitcode");
841-
CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile));
842-
FoundBCLibrary = true;
843-
break;
828+
CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetName));
829+
} else {
830+
getDriver().Diag(diag::err_drv_omp_offload_target_bcruntime_not_found)
831+
<< LibOmpTargetName;
832+
}
833+
} else {
834+
bool FoundBCLibrary = false;
835+
836+
std::string LibOmpTargetName =
837+
"libomptarget-nvptx-" + GpuArch.str() + ".bc";
838+
839+
for (StringRef LibraryPath : LibraryPaths) {
840+
SmallString<128> LibOmpTargetFile(LibraryPath);
841+
llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName);
842+
if (llvm::sys::fs::exists(LibOmpTargetFile)) {
843+
CC1Args.push_back("-mlink-builtin-bitcode");
844+
CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile));
845+
FoundBCLibrary = true;
846+
break;
847+
}
844848
}
849+
if (!FoundBCLibrary)
850+
getDriver().Diag(diag::err_drv_omp_offload_target_missingbcruntime)
851+
<< LibOmpTargetName;
845852
}
846-
if (!FoundBCLibrary)
847-
getDriver().Diag(diag::warn_drv_omp_offload_target_missingbcruntime)
848-
<< LibOmpTargetName;
849853
}
850854
}
851855

clang/lib/Frontend/ModuleDependencyCollector.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,17 +190,17 @@ std::error_code ModuleDependencyCollector::copyToRoot(StringRef Src,
190190
// Canonicalize src to a native path to avoid mixed separator styles.
191191
path::native(AbsoluteSrc);
192192
// Remove redundant leading "./" pieces and consecutive separators.
193-
AbsoluteSrc = path::remove_leading_dotslash(AbsoluteSrc);
193+
StringRef TrimmedAbsoluteSrc = path::remove_leading_dotslash(AbsoluteSrc);
194194

195195
// Canonicalize the source path by removing "..", "." components.
196-
SmallString<256> VirtualPath = AbsoluteSrc;
196+
SmallString<256> VirtualPath = TrimmedAbsoluteSrc;
197197
path::remove_dots(VirtualPath, /*remove_dot_dot=*/true);
198198

199199
// If a ".." component is present after a symlink component, remove_dots may
200200
// lead to the wrong real destination path. Let the source be canonicalized
201201
// like that but make sure we always use the real path for the destination.
202202
SmallString<256> CopyFrom;
203-
if (!getRealPath(AbsoluteSrc, CopyFrom))
203+
if (!getRealPath(TrimmedAbsoluteSrc, CopyFrom))
204204
CopyFrom = VirtualPath;
205205
SmallString<256> CacheDst = getDest();
206206

clang/lib/Sema/SemaCodeComplete.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,6 +2294,29 @@ static void AddOrdinaryNameResults(Sema::ParserCompletionContext CCC, Scope *S,
22942294
Builder.AddChunk(CodeCompletionString::CK_VerticalSpace);
22952295
Builder.AddChunk(CodeCompletionString::CK_RightBrace);
22962296
Results.AddResult(Result(Builder.TakeString()));
2297+
2298+
if (SemaRef.getLangOpts().CPlusPlus11 || SemaRef.getLangOpts().ObjC) {
2299+
// for ( range_declaration (:|in) range_expression ) { statements }
2300+
Builder.AddTypedTextChunk("for");
2301+
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
2302+
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
2303+
Builder.AddPlaceholderChunk("range-declaration");
2304+
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
2305+
if (SemaRef.getLangOpts().ObjC)
2306+
Builder.AddTextChunk("in");
2307+
else
2308+
Builder.AddChunk(CodeCompletionString::CK_Colon);
2309+
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
2310+
Builder.AddPlaceholderChunk("range-expression");
2311+
Builder.AddChunk(CodeCompletionString::CK_RightParen);
2312+
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
2313+
Builder.AddChunk(CodeCompletionString::CK_LeftBrace);
2314+
Builder.AddChunk(CodeCompletionString::CK_VerticalSpace);
2315+
Builder.AddPlaceholderChunk("statements");
2316+
Builder.AddChunk(CodeCompletionString::CK_VerticalSpace);
2317+
Builder.AddChunk(CodeCompletionString::CK_RightBrace);
2318+
Results.AddResult(Result(Builder.TakeString()));
2319+
}
22972320
}
22982321

22992322
if (S->getContinueParent()) {

clang/lib/Sema/SemaDecl.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3261,6 +3261,10 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD,
32613261
}
32623262
}
32633263

3264+
// If the old declaration was found in an inline namespace and the new
3265+
// declaration was qualified, update the DeclContext to match.
3266+
adjustDeclContextForDeclaratorDecl(New, Old);
3267+
32643268
// If the old declaration is invalid, just give up here.
32653269
if (Old->isInvalidDecl())
32663270
return true;
@@ -4080,6 +4084,10 @@ void Sema::MergeVarDecl(VarDecl *New, LookupResult &Previous) {
40804084
return New->setInvalidDecl();
40814085
}
40824086

4087+
// If the old declaration was found in an inline namespace and the new
4088+
// declaration was qualified, update the DeclContext to match.
4089+
adjustDeclContextForDeclaratorDecl(New, Old);
4090+
40834091
// Ensure the template parameters are compatible.
40844092
if (NewTemplate &&
40854093
!TemplateParameterListsAreEqual(NewTemplate->getTemplateParameters(),
@@ -4264,7 +4272,6 @@ void Sema::MergeVarDecl(VarDecl *New, LookupResult &Previous) {
42644272
New->setPreviousDecl(Old);
42654273
if (NewTemplate)
42664274
NewTemplate->setPreviousDecl(OldTemplate);
4267-
adjustDeclContextForDeclaratorDecl(New, Old);
42684275

42694276
// Inherit access appropriately.
42704277
New->setAccess(Old->getAccess());
@@ -10818,7 +10825,6 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
1081810825
NewTemplateDecl->mergePrevDecl(OldTemplateDecl);
1081910826

1082010827
NewFD->setPreviousDeclaration(OldFD);
10821-
adjustDeclContextForDeclaratorDecl(NewFD, OldFD);
1082210828
if (NewFD->isCXXClassMember()) {
1082310829
NewFD->setAccess(OldTemplateDecl->getAccess());
1082410830
NewTemplateDecl->setAccess(OldTemplateDecl->getAccess());
@@ -10845,7 +10851,6 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
1084510851
auto *OldFD = cast<FunctionDecl>(OldDecl);
1084610852
// This needs to happen first so that 'inline' propagates.
1084710853
NewFD->setPreviousDeclaration(OldFD);
10848-
adjustDeclContextForDeclaratorDecl(NewFD, OldFD);
1084910854
if (NewFD->isCXXClassMember())
1085010855
NewFD->setAccess(OldFD->getAccess());
1085110856
}

clang/test/CodeGen/aarch64-ls64.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ uint64_t status;
2121
// CHECK-NEXT: [[__ADDR_ADDR_I:%.*]] = alloca i8*, align 8
2222
// CHECK-NEXT: [[REF_TMP:%.*]] = alloca [[STRUCT_DATA512_T:%.*]], align 8
2323
// CHECK-NEXT: [[TMP0:%.*]] = load i8*, i8** @addr, align 8
24+
// CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !6)
2425
// CHECK-NEXT: store i8* [[TMP0]], i8** [[__ADDR_ADDR_I]], align 8, !noalias !6
2526
// CHECK-NEXT: [[TMP1:%.*]] = load i8*, i8** [[__ADDR_ADDR_I]], align 8, !noalias !6
2627
// CHECK-NEXT: [[VAL_I:%.*]] = getelementptr inbounds [[STRUCT_DATA512_T]], %struct.data512_t* [[REF_TMP]], i32 0, i32 0
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// REQUIRES: powerpc-registered-target
2+
// RUN: %clang_cc1 -triple powerpc-unknown-openbsd -emit-llvm -o - %s | FileCheck %s
3+
4+
#include <stdarg.h>
5+
6+
class something;
7+
typedef void (something::*method)();
8+
9+
method test(va_list ap) {
10+
return va_arg(ap, method);
11+
}
12+
// CHECK: using_regs:
13+
// CHECK-NEXT: getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %{{[0-9]+}}, i32 0, i32 4
14+
// CHECK-NEXT: load i8*, i8** %{{[0-9]+}}, align 4
15+
// CHECK-NEXT: mul i8 %numUsedRegs, 4
16+
// CHECK-NEXT: getelementptr inbounds i8, i8* %{{[0-9]+}}, i8 %{{[0-9]+}}
17+
// CHECK-NEXT: bitcast i8* %{{[0-9]+}} to { i32, i32 }**
18+
// CHECK-NEXT: add i8 %numUsedRegs, 1
19+
// CHECK-NEXT: store i8 %{{[0-9]+}}, i8* %gpr, align 4
20+
// CHECK-NEXT: br label %cont
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// REQUIRES: powerpc-registered-target
2+
// RUN: %clang_cc1 -triple powerpc-unknown-openbsd -fblocks -emit-llvm -o - %s | FileCheck %s
3+
4+
#include <stdarg.h>
5+
6+
id testObject(va_list ap) {
7+
return va_arg(ap, id);
8+
}
9+
// CHECK: @testObject
10+
// CHECK: using_regs:
11+
// CHECK-NEXT: getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %{{[0-9]+}}, i32 0, i32 4
12+
// CHECK-NEXT: load i8*, i8** %{{[0-9]+}}, align 4
13+
// CHECK-NEXT: mul i8 %numUsedRegs, 4
14+
// CHECK-NEXT: getelementptr inbounds i8, i8* %{{[0-9]+}}, i8 %{{[0-9]+}}
15+
// CHECK-NEXT: bitcast i8* %{{[0-9]+}} to i8**
16+
// CHECK-NEXT: add i8 %numUsedRegs, 1
17+
// CHECK-NEXT: store i8 %{{[0-9]+}}, i8* %gpr, align 4
18+
// CHECK-NEXT: br label %cont
19+
20+
typedef void (^block)(void);
21+
block testBlock(va_list ap) {
22+
return va_arg(ap, block);
23+
}
24+
// CHECK: @testBlock
25+
// CHECK: using_regs:
26+
// CHECK-NEXT: getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %{{[0-9]+}}, i32 0, i32 4
27+
// CHECK-NEXT: load i8*, i8** %{{[0-9]+}}, align 4
28+
// CHECK-NEXT: mul i8 %numUsedRegs, 4
29+
// CHECK-NEXT: getelementptr inbounds i8, i8* %{{[0-9]+}}, i8 %{{[0-9]+}}
30+
// CHECK-NEXT: bitcast i8* %{{[0-9]+}} to void ()**
31+
// CHECK-NEXT: add i8 %numUsedRegs, 1
32+
// CHECK-NEXT: store i8 %{{[0-9]+}}, i8* %gpr, align 4
33+
// CHECK-NEXT: br label %cont

clang/test/Driver/Inputs/libomptarget/libomptarget-nvptx-test.bc

Whitespace-only changes.

clang/test/Driver/clang-offload-bundler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2.notexist -outputs=%t.bundle.i 2>&1 | FileCheck %s -DFILE=%t.tgt2.notexist --check-prefix CK-ERR5
7777
// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.i,%t.tgt1,%t.tgt2 -inputs=%t.bundle.i.notexist -unbundle 2>&1 | FileCheck %s -DFILE=%t.bundle.i.notexist --check-prefix CK-ERR5
78-
// CK-ERR5: error: '[[FILE]]': {{N|n}}o such file or directory
78+
// CK-ERR5: error: '[[FILE]]': {{.*}}{{N|n}}o such file or directory
7979

8080
// RUN: not clang-offload-bundler -type=invalid -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle.i 2>&1 | FileCheck %s -DTYPE=invalid --check-prefix CK-ERR6
8181
// CK-ERR6: error: '[[TYPE]]': invalid file type specified

0 commit comments

Comments
 (0)