1
1
// Test without serialization:
2
- // RUN: %clang_cc1 -fsyntax-only -triple x86_64-pc-linux -std=c++11 -ast-dump %s \
2
+ // RUN: %clang_cc1 -fsyntax-only -triple x86_64-pc-linux -std=c++11 -fcxx-exceptions - ast-dump %s \
3
3
// RUN: | FileCheck --strict-whitespace %s
4
4
5
5
// Test with serialization:
6
- // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-pch -o %t %s
7
- // RUN: %clang_cc1 -x c++ -triple x86_64-pc-linux -include-pch %t -ast-dump-all /dev/null \
6
+ // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-pch -fcxx-exceptions - o %t %s
7
+ // RUN: %clang_cc1 -x c++ -triple x86_64-pc-linux -include-pch %t -fcxx-exceptions - ast-dump-all /dev/null \
8
8
// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
9
9
// RUN: | FileCheck --strict-whitespace %s
10
10
@@ -189,6 +189,7 @@ float func_18(float x, float y) {
189
189
// CHECK: BinaryOperator {{.*}} ConstRoundingMode=downward
190
190
191
191
#pragma float_control(precise, off)
192
+
192
193
__attribute__ ((optnone))
193
194
float func_19(float x, float y) {
194
195
return x + y;
@@ -198,3 +199,26 @@ float func_19(float x, float y) {
198
199
// CHECK: CompoundStmt {{.*}} MathErrno=1
199
200
// CHECK: ReturnStmt
200
201
// CHECK: BinaryOperator {{.*}} 'float' '+' ConstRoundingMode=downward MathErrno=1
202
+
203
+ __attribute__ ((optnone))
204
+ float func_20(float x, float y) try {
205
+ return x + y;
206
+ } catch (...) {
207
+ return 1.0 ;
208
+ }
209
+
210
+ // CHECK-LABEL: FunctionDecl {{.*}} func_20 'float (float, float)'
211
+ // CHECK: CompoundStmt {{.*}} ConstRoundingMode=downward MathErrno=1
212
+ // CHECK: ReturnStmt
213
+ // CHECK: BinaryOperator {{.*}} 'float' '+' ConstRoundingMode=downward MathErrno=1
214
+
215
+ struct C21 {
216
+ C21 (float x, float y);
217
+ float member;
218
+ };
219
+
220
+ __attribute__ ((optnone)) C21::C21(float x, float y) : member(x + y) {}
221
+
222
+ // CHECK-LABEL: CXXConstructorDecl {{.*}} C21 'void (float, float)'
223
+ // CHECK: CXXCtorInitializer {{.*}} 'member' 'float'
224
+ // CHECK: BinaryOperator {{.*}} 'float' '+' ConstRoundingMode=downward MathErrno=1
0 commit comments