xref: /llvm-project/clang/test/CodeGen/exceptions-strictfp.c (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1 // RUN: %clang_cc1 -triple armv7-apple-unknown -Wno-strict-prototypes -ffp-exception-behavior=strict -fexperimental-strict-floating-point -emit-llvm -o - %s -fexceptions -exception-model=sjlj -fblocks | FileCheck %s
2 
3 // Verify strictfp attributes on invoke calls (and therefore also on
4 // function definitions).
5 
test1(void)6 void test1(void) {
7   extern void test1_helper(void (^)(int));
8 
9   // CHECK: define{{.*}} arm_aapcscc void @test1() [[STRICTFP0:#[0-9]+]] personality ptr @__gcc_personality_sj0
10 
11   __block int x = 10;
12 
13   // CHECK: invoke arm_aapcscc void @test1_helper({{.*}}) [[STRICTFP1:#[0-9]+]]
14   test1_helper(^(int v) { x = v; });
15 
16   // CHECK:      landingpad { ptr, i32 }
17   // CHECK-NEXT:   cleanup
18 }
19 
20 void test2_helper();
test2(void)21 void test2(void) {
22   // CHECK: define{{.*}} arm_aapcscc void @test2() [[STRICTFP0]] personality ptr @__gcc_personality_sj0 {
23   __block int x = 10;
24   ^{ (void)x; };
25 
26   // CHECK: invoke arm_aapcscc void @test2_helper({{.*}}) [[STRICTFP1:#[0-9]+]]
27   test2_helper(5, 6, 7);
28 
29   // CHECK:      landingpad { ptr, i32 }
30   // CHECK-NEXT:   cleanup
31 }
test2_helper(int x,int y)32 void test2_helper(int x, int y) {
33 }
34 
35 // CHECK: attributes [[STRICTFP0]] = { {{.*}}strictfp{{.*}} }
36 // CHECK: attributes [[STRICTFP1]] = { strictfp }
37