diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-07-18 19:53:25 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-07-18 19:53:25 +0000 |
commit | 3606220f9c8f20fc2d967c40d65a0d631f4c36b2 (patch) | |
tree | 8e452a73c089cfc8dbf43152905b90155d935836 /test/CodeGenCXX/typeid-should-throw.cpp | |
parent | b7b8b123503d927518f5055a96f8a4630053768a (diff) |
Address Richard's latest feedback.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213404 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/typeid-should-throw.cpp')
-rw-r--r-- | test/CodeGenCXX/typeid-should-throw.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/test/CodeGenCXX/typeid-should-throw.cpp b/test/CodeGenCXX/typeid-should-throw.cpp index 08e304b13a..8b3f2ac0bb 100644 --- a/test/CodeGenCXX/typeid-should-throw.cpp +++ b/test/CodeGenCXX/typeid-should-throw.cpp @@ -1,10 +1,11 @@ -// RUN: %clang_cc1 %s -triple %itanium_abi_triple -Wno-unused-value -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple %itanium_abi_triple -Wno-unused-value -emit-llvm -o - -std=c++11 | FileCheck %s namespace std { struct type_info; } struct A { virtual ~A(); + operator bool(); }; struct B : A {}; @@ -53,6 +54,15 @@ void f9(A *x) { typeid(0[x]); } // CHECK: icmp eq {{.*}}, null // CHECK-NEXT: br i1 -void f10(A *x) { typeid((const A &)(A)*x); } -// CHECK-LABEL: define void @_Z3f10P1A +void f10(A *x, A *y) { typeid(*y ?: *x); } +// CHECK-LABEL: define void @_Z3f10P1AS0_ +// CHECK: icmp eq {{.*}}, null +// CHECK-NEXT: br i1 + +void f11(A *x) { typeid((const A &)(A)*x); } +// CHECK-LABEL: define void @_Z3f11P1A +// CHECK-NOT: icmp eq {{.*}}, null + +void f12(A *x) { typeid((A &&)*(A *)nullptr); } +// CHECK-LABEL: define void @_Z3f12P1A // CHECK-NOT: icmp eq {{.*}}, null |