diff options
Diffstat (limited to 'test/CodeGen/builtin-attributes.c')
-rw-r--r-- | test/CodeGen/builtin-attributes.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/CodeGen/builtin-attributes.c b/test/CodeGen/builtin-attributes.c index 822b8eecf7d7b..3781eba266948 100644 --- a/test/CodeGen/builtin-attributes.c +++ b/test/CodeGen/builtin-attributes.c @@ -15,3 +15,44 @@ void f1() { char* f2(char* a, char* b) { return __builtin_strstr(a, b); } + +// frexp is NOT readnone. It writes to its pointer argument. +// <rdar://problem/10070234> +// +// CHECK: f3 +// CHECK: call double @frexp(double % +// CHECK-NOT: readnone +// CHECK: call float @frexpf(float % +// CHECK-NOT: readnone +// CHECK: call double @frexpl(double % +// CHECK-NOT: readnone +// +// Same thing for modf and friends. +// +// CHECK: call double @modf(double % +// CHECK-NOT: readnone +// CHECK: call float @modff(float % +// CHECK-NOT: readnone +// CHECK: call double @modfl(double % +// CHECK-NOT: readnone +// +// CHECK: call double @remquo(double % +// CHECK-NOT: readnone +// CHECK: call float @remquof(float % +// CHECK-NOT: readnone +// CHECK: call double @remquol(double % +// CHECK-NOT: readnone +// CHECK: ret +int f3(double x) { + int e; + __builtin_frexp(x, &e); + __builtin_frexpf(x, &e); + __builtin_frexpl(x, &e); + __builtin_modf(x, &e); + __builtin_modff(x, &e); + __builtin_modfl(x, &e); + __builtin_remquo(x, x, &e); + __builtin_remquof(x, x, &e); + __builtin_remquol(x, x, &e); + return e; +} |