<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/74707>74707</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Memory sanitizer errors in OpenMP clang tests
</td>
</tr>
<tr>
<th>Labels</th>
<td>
openmp
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
arsenm
</td>
</tr>
</table>
<pre>
```
******************** TEST 'Clang :: OpenMP/xteam_red_codegen.cpp' FAILED ********************
Exit Code: 2
Command Output (stderr):
--
RUN: at line 2: /home/marsenau/src/scratch_dir_msan/llvm_build_msan/bin/clang -cc1 -internal-isystem /home/marsenau/src/scratch_dir_msan/llvm_build_msan/lib/clang/18/include -nostdsysteminc -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -fopenmp-target-ignore-env-vars -fopenmp-assume-no-nested-parallelism -fopenmp-assume-no-thread-state -emit-llvm-bc /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp -o /home/marsenau/src/scratch_dir_msan/llvm_build_msan/tools/clang/test/OpenMP/Output/xteam_red_codegen.cpp.tmp-ppc-host.bc
+ /home/marsenau/src/scratch_dir_msan/llvm_build_msan/bin/clang -cc1 -internal-isystem /home/marsenau/src/scratch_dir_msan/llvm_build_msan/lib/clang/18/include -nostdsysteminc -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -fopenmp-target-ignore-env-vars -fopenmp-assume-no-nested-parallelism -fopenmp-assume-no-thread-state -emit-llvm-bc /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp -o /home/marsenau/src/scratch_dir_msan/llvm_build_msan/tools/clang/test/OpenMP/Output/xteam_red_codegen.cpp.tmp-ppc-host.bc
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:12:12: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
12 | double a[N], b[N];
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:12:12: note: read of non-const variable 'N' is not allowed in a constant expression
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:10:7: note: declared here
10 | int N = 100;
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:12:18: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
12 | double a[N], b[N];
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:12:18: note: read of non-const variable 'N' is not allowed in a constant expression
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:10:7: note: declared here
10 | int N = 100;
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:13:12: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
13 | int bint[N];
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:13:12: note: read of non-const variable 'N' is not allowed in a constant expression
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:10:7: note: declared here
10 | int N = 100;
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:14:17: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
14 | unsigned cint[N];
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:14:17: note: read of non-const variable 'N' is not allowed in a constant expression
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:10:7: note: declared here
10 | int N = 100;
| ^
4 warnings generated.
RUN: at line 3: /home/marsenau/src/scratch_dir_msan/llvm_build_msan/bin/clang -cc1 -internal-isystem /home/marsenau/src/scratch_dir_msan/llvm_build_msan/lib/clang/18/include -nostdsysteminc -fopenmp -x c++ -std=c++11 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -fopenmp-target-ignore-env-vars -fopenmp-assume-no-nested-parallelism -fopenmp-assume-no-thread-state -emit-llvm /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp -fopenmp-is-device -fopenmp-host-ir-file-path /home/marsenau/src/scratch_dir_msan/llvm_build_msan/tools/clang/test/OpenMP/Output/xteam_red_codegen.cpp.tmp-ppc-host.bc -o - | /home/marsenau/src/scratch_dir_msan/llvm_build_msan/bin/FileCheck --allow-unused-prefixes /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp
+ /home/marsenau/src/scratch_dir_msan/llvm_build_msan/bin/clang -cc1 -internal-isystem /home/marsenau/src/scratch_dir_msan/llvm_build_msan/lib/clang/18/include -nostdsysteminc -fopenmp -x c++ -std=c++11 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -fopenmp-target-ignore-env-vars -fopenmp-assume-no-nested-parallelism -fopenmp-assume-no-thread-state -emit-llvm /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp -fopenmp-is-device -fopenmp-host-ir-file-path /home/marsenau/src/scratch_dir_msan/llvm_build_msan/tools/clang/test/OpenMP/Output/xteam_red_codegen.cpp.tmp-ppc-host.bc -o -
+ /home/marsenau/src/scratch_dir_msan/llvm_build_msan/bin/FileCheck --allow-unused-prefixes /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:12:12: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
12 | double a[N], b[N];
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:12:12: note: read of non-const variable 'N' is not allowed in a constant expression
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:10:7: note: declared here
10 | int N = 100;
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:12:18: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
12 | double a[N], b[N];
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:12:18: note: read of non-const variable 'N' is not allowed in a constant expression
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:10:7: note: declared here
10 | int N = 100;
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:13:12: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
13 | int bint[N];
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:13:12: note: read of non-const variable 'N' is not allowed in a constant expression
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:10:7: note: declared here
10 | int N = 100;
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:14:17: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
14 | unsigned cint[N];
| ^
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:14:17: note: read of non-const variable 'N' is not allowed in a constant expression
/home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp:10:7: note: declared here
10 | int N = 100;
| ^
==245306==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x5588e2264274 in clang::CodeGen::CodeGenModule::resetOptKernelMetadata(clang::Stmt const*) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:8808:24
#1 0x5588e2871c0f in clang::CodeGen::CGOpenMPRuntimeGPU::emitTargetOutlinedFunction(clang::OMPExecutableDirective const&, llvm::StringRef, llvm::Function*&, llvm::Constant*&, bool, clang::CodeGen::RegionCodeGenTy const&) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp:1067:9
#2 0x5588e29336b3 in clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsDistributeParallelForDeviceFunction(clang::CodeGen::CodeGenModule&, llvm::StringRef, clang::OMPTargetTeamsDistributeParallelForDirective const&) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/CodeGen/CGStmtOpenMP.cpp:7367:26
#3 0x5588e275de37 in clang::CodeGen::CGOpenMPRuntime::scanForTargetRegionsFunctions(clang::Stmt const*, llvm::StringRef) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp:9902:7
#4 0x5588e275d682 in clang::CodeGen::CGOpenMPRuntime::scanForTargetRegionsFunctions(clang::Stmt const*, llvm::StringRef) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp:9999:5
#5 0x5588e275e4fc in clang::CodeGen::CGOpenMPRuntime::emitTargetFunctions(clang::GlobalDecl) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp:10031:5
#6 0x5588e222ac60 in clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:3695:41
#7 0x5588e2219911 in clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:6677:5
#8 0x5588e320fecc in (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/CodeGen/ModuleBuilder.cpp:190:18
#9 0x5588e31eafa5 in clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:207:8
#10 0x5588e80f8b28 in clang::ParseAST(clang::Sema&, bool, bool) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/Parse/ParseAST.cpp:167:31
#11 0x5588e3da61bd in clang::FrontendAction::Execute() /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1069:8
#12 0x5588e3bfb0c0 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:1057:33
#13 0x5588e4007a26 in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:272:25
#14 0x5588db24c414 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/tools/driver/cc1_main.cpp:294:15
#15 0x5588db243ebd in ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/tools/driver/driver.cpp:382:12
#16 0x5588db240e4a in clang_main(int, char**, llvm::ToolContext const&) /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/tools/driver/driver.cpp:423:12
#17 0x5588db2701f7 in main /home/marsenau/src/scratch_dir_msan/llvm_build_msan/tools/clang/tools/driver/clang-driver.cpp:15:10
#18 0x7f53d410bd8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#19 0x7f53d410be3f in __libc_start_main csu/../csu/libc-start.c:392:3
#20 0x5588db1a96a4 in _start (/home/marsenau/src/scratch_dir_msan/llvm_build_msan/bin/clang-18+0x578d6a4)
SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:8808:24 in clang::CodeGen::CodeGenModule::resetOptKernelMetadata(clang::Stmt const*)
Exiting
FileCheck error: '<stdin>' is empty.
FileCheck command line: /home/marsenau/src/scratch_dir_msan/llvm_build_msan/bin/FileCheck --allow-unused-prefixes /home/marsenau/src/lightning-amd-stg-open/lightning/compiler/llvm-project/clang/test/OpenMP/xteam_red_codegen.cpp
--
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsW9tu4zjSfhrlhqAhUeeLXDh2nL_xTw5IMjvYq4Ciyja3KUogKbczT7-gDpbspDPb042002Mg0YGmyfq-qiKLZZJqzVcS4NwJL5xwfkZrsy7VOVUaZHGWlfnzuRO53Z87d9ypQ_7-H3q8fHhEDolngsoVcvyp40_RbQXy-s4hi60BWjwpyJ9YmcMK5IRVlUNitJh--u1yjr6n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