llvm-project
28 строк · 2.0 Кб
1// RUN: rm -rf %t && mkdir -p %t
2// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -Wno-private-module -fdisable-module-hash -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -verify
3// RUN: %clang_cc1 -ast-print %t/ModulesCache/SimpleKit.pcm | FileCheck %s
4
5#import <SomeKit/SomeKit.h>
6#import <SimpleKit/SimpleKit.h>
7
8// CHECK: struct __attribute__((swift_name("SuccessfullyRenamedA"))) RenamedAgainInAPINotesA {
9// CHECK: struct __attribute__((swift_name("SuccessfullyRenamedB"))) RenamedAgainInAPINotesB {
10
11void test(OverriddenTypes *overridden) {
12int *ip1 = global_int_ptr; // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'double (*)(int, int)'}}
13
14int *ip2 = global_int_fun( // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'char *'}}
15ip2, // expected-warning{{incompatible pointer types passing 'int *' to parameter of type 'double *'}}
16ip2); // expected-warning{{incompatible pointer types passing 'int *' to parameter of type 'float *'}}
17
18int *ip3 = [overridden // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'char *'}}
19methodToMangle: ip3 // expected-warning{{incompatible pointer types sending 'int *' to parameter of type 'double *'}}
20second: ip3]; // expected-warning{{incompatible pointer types sending 'int *' to parameter of type 'float *'}}
21
22int *ip4 = overridden.intPropertyToMangle; // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'double *'}}
23}
24
25// expected-note@SomeKit/SomeKit.h:42{{passing argument to parameter 'ptr' here}}
26// expected-note@SomeKit/SomeKit.h:42{{passing argument to parameter 'ptr2' here}}
27// expected-note@SomeKit/SomeKit.h:48{{passing argument to parameter 'ptr1' here}}
28// expected-note@SomeKit/SomeKit.h:48{{passing argument to parameter 'ptr2' here}}
29