2010-09-17 23:51:28 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
|
|
|
|
// rdar: // 8353567
|
|
|
|
// pr7726
|
|
|
|
|
|
|
|
extern "C" int printf(...);
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
// CHECK: phi i8* [ inttoptr (i64 3735928559 to i8*),
|
|
|
|
printf("%p\n", (void *)0xdeadbeef ? : (void *)0xaaaaaa);
|
|
|
|
return 0;
|
|
|
|
}
|
2010-09-19 03:38:38 +08:00
|
|
|
|
|
|
|
// rdar://8446940
|
|
|
|
namespace radar8446940 {
|
|
|
|
extern "C" void abort();
|
|
|
|
|
|
|
|
int main () {
|
|
|
|
char x[1];
|
|
|
|
char *y = x ? : 0;
|
|
|
|
|
|
|
|
if (x != y)
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
}
|
2010-09-21 07:50:22 +08:00
|
|
|
|
|
|
|
namespace radar8453812 {
|
|
|
|
extern "C" void abort();
|
|
|
|
_Complex int getComplex(_Complex int val) {
|
|
|
|
static int count;
|
|
|
|
if (count++)
|
|
|
|
abort();
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
|
|
|
|
_Complex int cmplx() {
|
|
|
|
_Complex int cond;
|
|
|
|
_Complex int rhs;
|
|
|
|
|
|
|
|
return getComplex(1+2i) ? : rhs;
|
|
|
|
}
|
|
|
|
|
2010-09-22 02:32:21 +08:00
|
|
|
// lvalue test
|
|
|
|
void foo (int& lv) {
|
|
|
|
++lv;
|
|
|
|
}
|
|
|
|
|
|
|
|
int global = 1;
|
|
|
|
|
|
|
|
int &cond() {
|
|
|
|
static int count;
|
|
|
|
if (count++)
|
|
|
|
abort();
|
|
|
|
return global;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-09-21 07:50:22 +08:00
|
|
|
int main() {
|
|
|
|
cmplx();
|
2010-09-22 02:32:21 +08:00
|
|
|
int rhs = 10;
|
|
|
|
foo (cond()? : rhs);
|
|
|
|
return global-2;
|
2010-09-21 07:50:22 +08:00
|
|
|
}
|
|
|
|
}
|