]> granicus.if.org Git - clang/commitdiff
Update for DiagnosticInfoStackSize changes
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 20 Jun 2016 18:13:09 +0000 (18:13 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 20 Jun 2016 18:13:09 +0000 (18:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273178 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenAction.cpp
test/Misc/backend-resource-limit-diagnostics.cl [new file with mode: 0644]

index 848acb4fe0798add6c52c935b9fa96c36c88f9cf..8861840516549cbf802c9673433c76afe4a6ddb4 100644 (file)
@@ -415,9 +415,10 @@ BackendConsumer::StackSizeDiagHandler(const llvm::DiagnosticInfoStackSize &D) {
     return false;
 
   if (const Decl *ND = Gen->GetDeclForMangledName(D.getFunction().getName())) {
+    // FIXME: Shouldn't need to truncate to uint32_t
     Diags.Report(ND->getASTContext().getFullLoc(ND->getLocation()),
                  diag::warn_fe_frame_larger_than)
-        << D.getStackSize() << Decl::castToDeclContext(ND);
+      << static_cast<uint32_t>(D.getStackSize()) << Decl::castToDeclContext(ND);
     return true;
   }
 
diff --git a/test/Misc/backend-resource-limit-diagnostics.cl b/test/Misc/backend-resource-limit-diagnostics.cl
new file mode 100644 (file)
index 0000000..6e7619b
--- /dev/null
@@ -0,0 +1,9 @@
+// REQUIRES: amdgpu-registered-target
+// RUN: not %clang_cc1 -emit-codegen-only -triple=amdgcn-- %s 2>&1 | FileCheck %s
+
+// CHECK: error: local memory limit exceeded (480000) in use_huge_lds
+kernel void use_huge_lds()
+{
+    volatile local int huge[120000];
+    huge[0] = 2;
+}