Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / try-catch-with-address-space.cpp
blob279d29f50fd41010916bfed9d41fe70e1c5cec26
1 // RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s
3 struct X { };
5 const X g();
7 void f() {
8 try {
9 throw g();
10 // CHECK: ptr addrspace(1) @_ZTI1X
11 } catch (const X x) {
12 // CHECK: catch ptr addrspace(1) @_ZTI1X
13 // CHECK: call i32 @llvm.eh.typeid.for(ptr addrspacecast (ptr addrspace(1) @_ZTI1X to ptr))
17 void h() {
18 try {
19 throw "ABC";
20 // CHECK: ptr addrspace(1) @_ZTIPKc
21 } catch (char const(&)[4]) {
22 // CHECK: catch ptr addrspace(1) @_ZTIA4_c
23 // CHECK: call i32 @llvm.eh.typeid.for(ptr addrspacecast (ptr addrspace(1) @_ZTIA4_c to ptr))