[clang] [HLSL] Add test for export function redeclaration (PR #97370)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 1 18:32:25 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Helena Kotas (hekota)

<details>
<summary>Changes</summary>

Related to llvm/llvm-project#<!-- -->92812

---
Full diff: https://github.com/llvm/llvm-project/pull/97370.diff


1 Files Affected:

- (modified) clang/test/SemaHLSL/export.hlsl (+6) 


``````````diff
diff --git a/clang/test/SemaHLSL/export.hlsl b/clang/test/SemaHLSL/export.hlsl
index 9c624d6142232..2d19fa561fa0a 100644
--- a/clang/test/SemaHLSL/export.hlsl
+++ b/clang/test/SemaHLSL/export.hlsl
@@ -35,6 +35,12 @@ static void f9(); // expected-error {{static declaration of 'f9' follows non-sta
 static void f10(); // expected-note {{previous declaration is here}}
 export void f10(); // expected-error {{cannot export redeclaration 'f10' here since the previous declaration has internal linkage}}
 
+export void f11();
+void f11() {}
+
+void f12();           //   expected-note{{previous declaration is here}}
+export void f12() {}  //   expected-error{{cannot export redeclaration 'f12' here since the previous declaration is not exported}}
+
 export float V1; // expected-error {{export declaration can only be used on functions}}
 
 static export float V2; // expected-error{{expected unqualified-id}}

``````````

</details>


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


More information about the cfe-commits mailing list