diff options
author | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
commit | 173a4f43a911175643bda81ee675e8d9269056ea (patch) | |
tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /test/CodeGenCXX/throw-expressions.cpp | |
parent | 88f7a7d5251a2d813460274c92decc143a11569b (diff) | |
download | FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.zip FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.tar.gz |
Vendor import of clang RELEASE_350/final tag r216957 (effectively, 3.5.0 release):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_350/final@216957
Diffstat (limited to 'test/CodeGenCXX/throw-expressions.cpp')
-rw-r--r-- | test/CodeGenCXX/throw-expressions.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/CodeGenCXX/throw-expressions.cpp b/test/CodeGenCXX/throw-expressions.cpp index d9bf8fd..4dd5322 100644 --- a/test/CodeGenCXX/throw-expressions.cpp +++ b/test/CodeGenCXX/throw-expressions.cpp @@ -67,3 +67,48 @@ int test6(bool x, bool y, int z) { // // end: // CHECK: ret i32 + +namespace DR1560 { + struct A { + ~A(); + }; + extern bool b; + A get(); + // CHECK-LABEL: @_ZN6DR15601bE + const A &r = b ? get() : throw 0; + // CHECK-NOT: call {{.*}}@_ZN6DR15601AD1Ev + // CHECK: call {{.*}} @__cxa_atexit({{.*}} @_ZN6DR15601AD1Ev {{.*}} @_ZGRN6DR15601rE + // CHECK-NOT: call {{.*}}@_ZN6DR15601AD1Ev +} + +// CHECK-LABEL: define void @_Z5test7b( +void test7(bool cond) { + // CHECK: br i1 + // + // x.true: + // CHECK: call void @__cxa_throw( + // CHECK-NEXT: unreachable + // + // x.false: + // CHECK: br label + // + // end: + // CHECK: ret void + cond ? throw test7 : val; +} + +// CHECK-LABEL: define dereferenceable(4) i32* @_Z5test8b( +int &test8(bool cond) { + // CHECK: br i1 + // + // x.true: + // CHECK: br label + // + // x.false: + // CHECK: call void @__cxa_throw( + // CHECK-NEXT: unreachable + // + // end: + // CHECK: ret i32* @val + return cond ? val : ((throw "foo")); +} |