[InstCombine] Preserve NSW flags for `lshr (mul nuw X, C1), C2 -> mul nuw nsw X,...
[llvm-project.git] / clang / test / SemaObjC / warn-incompatible-builtin-types.m
blobf69ca09b356739101b4e7c00c311d7b213371018
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 @interface Foo
4 - (void)foo:(Class)class; // expected-note{{passing argument to parameter 'class' here}}
5 @end
7 void FUNC(void) {
8     Class c, c1;
9     SEL s1, s2;
10     id i, i1;
11     Foo *f;
12     [f foo:f];  // expected-warning {{incompatible pointer types sending 'Foo *' to parameter of type 'Class'}}
13     c = f;      // expected-warning {{incompatible pointer types assigning to 'Class' from 'Foo *'}}
15     c = i;
17     i = c;
19     c = c1;
21     i = i1;
23     s1 = i;     // expected-warning {{incompatible pointer types assigning to 'SEL' from 'id'}}
24     i = s1;     // expected-warning {{incompatible pointer types assigning to 'id' from 'SEL'}}
26     s1 = s2;
28     s1 = c;     // expected-warning {{incompatible pointer types assigning to 'SEL' from 'Class'}}
30     c = s1;     // expected-warning {{incompatible pointer types assigning to 'Class' from 'SEL'}}
32     f = i;
34     f = c;      // expected-warning {{incompatible pointer types assigning to 'Foo *' from 'Class'}}
36     f = s1;     // expected-warning {{incompatible pointer types assigning to 'Foo *' from 'SEL'}}
38     i = f;
40     s1 = f;     // expected-warning {{incompatible pointer types assigning to 'SEL' from 'Foo *'}}