Skip to content

Commit 564e13b

Browse files
committed
Ignore unnecessary parts of IR
1 parent fda0dbe commit 564e13b

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1-
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s -O1 -fexceptions -fcxx-exceptions | FileCheck %s
1+
// RUN: %clang_cc1 -emit-llvm -o - %s -O1 -fexceptions -fcxx-exceptions | FileCheck %s
2+
3+
extern "C" {
24

35
struct Trivial {
46
int x[100];
57
};
68

79
void func_that_throws(Trivial t);
810

9-
// CHECK-LABEL: define dso_local void @_Z4testv(){{.*}} personality ptr @__gxx_personality_v0
11+
// CHECK-LABEL: define{{.*}} void @test()
1012
void test() {
11-
// CHECK: %[[AGG1:.*]] = alloca %struct.Trivial, align
12-
// CHECK: %[[AGG2:.*]] = alloca %struct.Trivial, align
13+
// CHECK: %[[AGG1:.*]] = alloca %struct.Trivial
14+
// CHECK: %[[AGG2:.*]] = alloca %struct.Trivial
1315

14-
// CHECK: call void @llvm.lifetime.start.p0(ptr nonnull %[[AGG1]])
15-
// CHECK: invoke void @_Z16func_that_throws7Trivial(ptr noundef nonnull byval(%struct.Trivial) align 8 %[[AGG1]])
16+
// CHECK: call void @llvm.lifetime.start.p0(ptr{{.*}} %[[AGG1]])
17+
// CHECK: invoke void @func_that_throws(ptr{{.*}} %[[AGG1]])
1618
// CHECK-NEXT: to label %[[CONT1:.*]] unwind label %[[LPAD1:.*]]
1719

1820
// CHECK: [[CONT1]]:
19-
// CHECK-NEXT: call void @llvm.lifetime.start.p0(ptr nonnull %[[AGG2]])
20-
// CHECK: invoke void @_Z16func_that_throws7Trivial(ptr noundef nonnull byval(%struct.Trivial) align 8 %[[AGG2]])
21+
// CHECK-NEXT: call void @llvm.lifetime.start.p0(ptr{{.*}} %[[AGG2]])
22+
// CHECK: invoke void @func_that_throws(ptr{{.*}} %[[AGG2]])
2123
// CHECK-NEXT: to label %[[CONT2:.*]] unwind label %[[LPAD2:.*]]
2224

2325
// CHECK: [[CONT2]]:
24-
// CHECK-DAG: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG2]])
25-
// CHECK-DAG: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG1]])
26+
// CHECK-DAG: call void @llvm.lifetime.end.p0(ptr{{.*}} %[[AGG2]])
27+
// CHECK-DAG: call void @llvm.lifetime.end.p0(ptr{{.*}} %[[AGG1]])
2628
// CHECK: br label %[[TRY_CONT:.*]]
2729

2830
// CHECK: [[LPAD1]]:
@@ -31,15 +33,15 @@ void test() {
3133

3234
// CHECK: [[LPAD2]]:
3335
// CHECK: landingpad
34-
// CHECK: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG2]])
36+
// CHECK: call void @llvm.lifetime.end.p0(ptr{{.*}} %[[AGG2]])
3537
// CHECK: br label %[[EHCLEANUP]]
3638

3739
// CHECK: [[EHCLEANUP]]:
38-
// CHECK: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG1]])
39-
// CHECK: call ptr @__cxa_begin_catch
40+
// CHECK: call void @llvm.lifetime.end.p0(ptr{{.*}} %[[AGG1]])
4041
try {
4142
func_that_throws(Trivial{0});
4243
func_that_throws(Trivial{0});
4344
} catch (...) {
4445
}
4546
}
47+
} // end extern "C"

0 commit comments

Comments
 (0)