xref: /llvm-project/clang/test/PCH/pragma-weak-functional.c (revision 8cdb1aa1ec2ba15f5ec8641f5ece23758bf15a06)
1 // Test this without pch.
2 // RUN: %clang_cc1 -include %S/pragma-weak-functional.h %s -verify -emit-llvm -o - | FileCheck %s
3 
4 // Test with pch.
5 // RUN: %clang_cc1 -x c-header -emit-pch -o %t %S/pragma-weak-functional.h
6 // RUN: %clang_cc1 -include-pch %t %s -verify -emit-llvm -o - | FileCheck %s
7 
8 // CHECK-DAG: @undecfunc_alias1 = weak{{.*}} alias void (), ptr @undecfunc
9 // CHECK-DAG: @undecfunc_alias2 = weak{{.*}} alias void (), ptr @undecfunc
10 // CHECK-DAG: @undecfunc_alias3 = weak{{.*}} alias void (), ptr @undecfunc
11 // CHECK-DAG: @undecfunc_alias4 = weak{{.*}} alias void (), ptr @undecfunc
12 
13 ///////////// PR28611: Try multiple aliases of same undeclared symbol or alias
14 void undecfunc_alias1(void);
undecfunc(void)15 void undecfunc(void) { }
16 // expected-warning@pragma-weak-functional.h:4 {{alias will always resolve to undecfunc}}
17 // expected-warning@pragma-weak-functional.h:5 {{alias will always resolve to undecfunc}}
18