blob: 33e8e63de2f4a52382ef30c49f2f558fa45fc234 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -emit-llvm -x c++ < %s
Nuno Lopes32f62092009-01-11 23:22:37 +00002
Chris Lattner7804bcb2009-10-17 04:24:20 +00003void test0(int x) {
Nuno Lopes32f62092009-01-11 23:22:37 +00004 if (x != 0) return;
5}
Chris Lattner7804bcb2009-10-17 04:24:20 +00006
7
8// PR5211
9void test1() {
10 char *xpto;
11 while ( true && xpto[0] );
12}
Chris Lattner197a3382010-01-09 21:44:40 +000013
14// PR5514
15int a;
16void test2() { ++a+=10; }
Chris Lattner5c12c7b2010-08-17 23:58:10 +000017
18// PR7892
19int test3(const char*);
20int test3g = test3(__PRETTY_FUNCTION__);
Chris Lattnerd7241c72010-08-18 00:08:27 +000021
22
23// PR7889
24struct test4A {
25 int j : 2;
26};
27int test4() {
28 test4A a;
29 (a.j = 2) = 3;
30}
Daniel Dunbarf52697a2010-08-21 02:46:28 +000031
32// Incomplete type in conditional operator.
33// Check operations on incomplete types.
34struct s5;
35struct s5 &f5_0(bool cond, struct s5 &a, struct s5 &b) {
36 return cond ? a : b;
37}