[clang] [C++20] [Modules] Fix thread_local variable handling in modules (PR #189796)

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 1 02:17:12 PDT 2026


zmodem wrote:

We're seeing test errors: (https://ci.chromium.org/ui/p/chromium/builders/try/mac_upload_clang_arm/6724/overview)

```
 FAIL: Clang :: Modules/pr189415.cppm (16440 of 94386)
 ******************** TEST 'Clang :: Modules/pr189415.cppm' FAILED ********************
 Exit Code: 1
 
 Command Output (stdout):
 --
 # RUN: at line 1
 rm -rf /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/clang/test/Modules/Output/pr189415.cppm.tmp
 # executed command: rm -rf /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/clang/test/Modules/Output/pr189415.cppm.tmp
 # RUN: at line 2
 mkdir -p /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/clang/test/Modules/Output/pr189415.cppm.tmp
 # executed command: mkdir -p /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/clang/test/Modules/Output/pr189415.cppm.tmp
 # RUN: at line 3
 split-file /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/clang/test/Modules/pr189415.cppm /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/clang/test/Modules/Output/pr189415.cppm.tmp
 # executed command: split-file /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/clang/test/Modules/pr189415.cppm /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/clang/test/Modules/Output/pr189415.cppm.tmp
 # RUN: at line 5
 /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/bin/clang -cc1 -internal-isystem /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/lib/clang/23/include -nostdsysteminc -std=c++20 /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/clang/test/Modules/Output/pr189415.cppm.tmp/counter.cppm -triple arm64-apple-darwin-unknown    -emit-reduced-module-interface -o /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/clang/test/Modules/Output/pr189415.cppm.tmp/counter.pcm
 # executed command: /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/bin/clang -cc1 -internal-isystem /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/lib/clang/23/include -nostdsysteminc -std=c++20 /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/clang/test/Modules/Output/pr189415.cppm.tmp/counter.cppm -triple arm64-apple-darwin-unknown -emit-reduced-module-interface -o /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/clang/test/Modules/Output/pr189415.cppm.tmp/counter.pcm
 # .---command stderr------------
 # | /Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/tools/clang/test/Modules/Output/pr189415.cppm.tmp/counter.cppm:6:1: error: thread-local storage is not supported for the current target
 # |     6 | thread_local int next = 1;
 # |       | ^
 # | 1 error generated.
 # `-----------------------------
 # error: command failed with exit status: 1
 
 --
```

Maybe the test should specify an explicitly triple?

https://github.com/llvm/llvm-project/pull/189796


More information about the cfe-commits mailing list