[clang] [clang] Add support for MSVC force inline attrs (PR #185282)

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 31 06:09:04 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 87199 tests passed
* 1355 tests skipped
* 3 tests failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.CodeGen/attr-ms-forceinline.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++23 -emit-llvm /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/attr-ms-forceinline.cpp -triple x86_64-pc-windows-msvc -fms-extensions -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-MSVC /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/attr-ms-forceinline.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++23 -emit-llvm /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/attr-ms-forceinline.cpp -triple x86_64-pc-windows-msvc -fms-extensions -o -
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=CHECK-MSVC /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/attr-ms-forceinline.cpp
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/attr-ms-forceinline.cpp:27:16: error: CHECK-MSVC: expected string not found in input
# | // CHECK-MSVC: call void @"?bar@@YAXXZ"() #[[ALWAYSINLINEATTR:[0-9]+]]
# |                ^
# | <stdin>:43:49: note: scanning from here
# | define dso_local void @"?call_bar_stmt@@YAXXZ"() #1 {
# |                                                 ^
# | <stdin>:52:1: note: possible intended match here
# | !llvm.dbg.cu = !{!0}
# | ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/attr-ms-forceinline.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            38:  
# |            39: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) 
# |            40: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #2 
# |            41:  
# |            42: ; Function Attrs: mustprogress noinline nounwind optnone 
# |            43: define dso_local void @"?call_bar_stmt@@YAXXZ"() #1 { 
# | check:27'0                                                     X~~~~~ error: no match found
# |            44: entry: 
# | check:27'0     ~~~~~~~
# |            45:  ret void 
# | check:27'0     ~~~~~~~~~~
# |            46: } 
# | check:27'0     ~~
# |            47:  
# | check:27'0     ~
# |            48: attributes #0 = { alwaysinline mustprogress nounwind "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" } 
# | check:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            49: attributes #1 = { mustprogress noinline nounwind optnone "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" } 
# | check:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            50: attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } 
# | check:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            51:  
# | check:27'0     ~
# |            52: !llvm.dbg.cu = !{!0} 
# | check:27'0     ~~~~~~~~~~~~~~~~~~~~~
# | check:27'1     ?                     possible intended match
# |            53: !llvm.module.flags = !{!2, !3} 
# | check:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            54: !llvm.ident = !{!4} 
# | check:27'0     ~~~~~~~~~~~~~~~~~~~~
# |            55:  
# | check:27'0     ~
# |            56: !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 23.0.0git (https://github.com/llvm/llvm-project f81e0fe2d77242f7aac70e207f6f7e8bf68d1cb7)", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug, splitDebugInlining: false, nameTableKind: None) 
# | check:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            57: !1 = !DIFile(filename: "/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/<stdin>", directory: "") 
# | check:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Clang.Sema/attr-ms-forceinline.c</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -verify=ms-ext -fms-extensions -fsyntax-only -std=c23 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/attr-ms-forceinline.c
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -verify=ms-ext -fms-extensions -fsyntax-only -std=c23 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/attr-ms-forceinline.c
# .---command stderr------------
# | error: 'ms-ext-error' diagnostics expected but not seen: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/attr-ms-forceinline.c Line 29 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/attr-ms-forceinline.c:30): 'msvc::forceinline' attribute takes no arguments
# | error: 'ms-ext-error' diagnostics seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/attr-ms-forceinline.c Line 29: 'msvc::forceinline_calls' attribute takes no arguments
# | 2 errors generated.
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Clang.Sema/attr-ms-forceinline.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -verify=ms-ext -fms-extensions -fsyntax-only -std=c++23 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/attr-ms-forceinline.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -verify=ms-ext -fms-extensions -fsyntax-only -std=c++23 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/attr-ms-forceinline.cpp
# .---command stderr------------
# | error: 'ms-ext-error' diagnostics expected but not seen: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/attr-ms-forceinline.cpp Line 35 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/attr-ms-forceinline.cpp:36): 'msvc::forceinline' attribute takes no arguments
# | error: 'ms-ext-error' diagnostics seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/attr-ms-forceinline.cpp Line 35: 'msvc::forceinline_calls' attribute takes no arguments
# | 2 errors generated.
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the cfe-commits mailing list