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

via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 13 12:39:54 PDT 2024


Author: Helena Kotas
Date: 2024-07-13T11:39:51-08:00
New Revision: f4254f3f517c60deeb2ba309c3bb5dfb644bed89

URL: https://github.com/llvm/llvm-project/commit/f4254f3f517c60deeb2ba309c3bb5dfb644bed89
DIFF: https://github.com/llvm/llvm-project/commit/f4254f3f517c60deeb2ba309c3bb5dfb644bed89.diff

LOG: [HLSL] Add test for export function redeclaration (#97370)

Related to llvm/llvm-project#92812

Added: 
    

Modified: 
    clang/test/SemaHLSL/export.hlsl

Removed: 
    


################################################################################
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}}


        


More information about the cfe-commits mailing list