2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -x c++ < %s
|
2009-01-12 02:22:37 +03:00
|
|
|
|
2009-10-17 08:24:20 +04:00
|
|
|
void test0(int x) {
|
2009-01-12 02:22:37 +03:00
|
|
|
if (x != 0) return;
|
|
|
|
}
|
2009-10-17 08:24:20 +04:00
|
|
|
|
|
|
|
|
|
|
|
// PR5211
|
|
|
|
void test1() {
|
|
|
|
char *xpto;
|
|
|
|
while ( true && xpto[0] );
|
|
|
|
}
|
2010-01-10 00:44:40 +03:00
|
|
|
|
|
|
|
// PR5514
|
|
|
|
int a;
|
|
|
|
void test2() { ++a+=10; }
|
2010-08-18 03:58:10 +04:00
|
|
|
|
|
|
|
// PR7892
|
|
|
|
int test3(const char*);
|
|
|
|
int test3g = test3(__PRETTY_FUNCTION__);
|
2010-08-18 04:08:27 +04:00
|
|
|
|
|
|
|
|
|
|
|
// PR7889
|
|
|
|
struct test4A {
|
|
|
|
int j : 2;
|
|
|
|
};
|
|
|
|
int test4() {
|
|
|
|
test4A a;
|
|
|
|
(a.j = 2) = 3;
|
|
|
|
}
|
2010-08-21 06:46:28 +04:00
|
|
|
|
|
|
|
// Incomplete type in conditional operator.
|
|
|
|
// Check operations on incomplete types.
|
|
|
|
struct s5;
|
|
|
|
struct s5 &f5_0(bool cond, struct s5 &a, struct s5 &b) {
|
|
|
|
return cond ? a : b;
|
|
|
|
}
|