diff options
author | John McCall <rjmccall@apple.com> | 2011-02-21 02:28:50 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-21 02:28:50 +0000 |
commit | f2e9110a9f5585f77987756fb4ffd970e5f0018c (patch) | |
tree | f01222cb0bb0e6a906072a948d5b3304c83cf26c /clang/test/CodeGenCXX/conditional-gnu-ext.cpp | |
parent | e9cba7bd3475ff0c115b42c584e423983962ad28 (diff) | |
download | llvm-f2e9110a9f5585f77987756fb4ffd970e5f0018c.zip llvm-f2e9110a9f5585f77987756fb4ffd970e5f0018c.tar.gz llvm-f2e9110a9f5585f77987756fb4ffd970e5f0018c.tar.bz2 |
Rename test/CodeGenCXX/gnu-conditional-scalar-ext.cpp to conditional-gnu-ext.cpp
for consistency with other tests (and to remove "scalar" from the name).
llvm-svn: 126104
Diffstat (limited to 'clang/test/CodeGenCXX/conditional-gnu-ext.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/conditional-gnu-ext.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/conditional-gnu-ext.cpp b/clang/test/CodeGenCXX/conditional-gnu-ext.cpp new file mode 100644 index 0000000..fea8364 --- /dev/null +++ b/clang/test/CodeGenCXX/conditional-gnu-ext.cpp @@ -0,0 +1,62 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s +// rdar: // 8353567 +// pr7726 + +extern "C" int printf(...); + +void test0() { +// CHECK: call i32 (...)* @printf({{.*}}, i8* inttoptr (i64 3735928559 to i8*)) + printf("%p\n", (void *)0xdeadbeef ? : (void *)0xaaaaaa); +} + +// rdar://8446940 +namespace radar8446940 { +extern "C" void abort(); + +int main () { + char x[1]; + char *y = x ? : 0; + + if (x != y) + abort(); +} +} + +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; +} + +// lvalue test +void foo (int& lv) { + ++lv; +} + +int global = 1; + +int &cond() { + static int count; + if (count++) + abort(); + return global; +} + + +int main() { + cmplx(); + int rhs = 10; + foo (cond()? : rhs); + return global-2; +} +} |