Jim Grosbach | f794705 | 2012-07-09 18:34:21 +0000 | [diff] [blame] | 1 | // REQUIRES: arm-registered-target |
Rafael Espindola | 1ed1a59 | 2010-06-16 19:01:17 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -triple arm-unknown-linux-gnueabi -emit-llvm -o - %s | FileCheck %s |
Daniel Dunbar | 34771b5 | 2009-09-14 04:33:21 +0000 | [diff] [blame] | 3 | |
Rafael Espindola | 75d0f82 | 2010-06-16 17:49:52 +0000 | [diff] [blame] | 4 | // CHECK: declare i32 @printf(i8*, ...) |
Daniel Dunbar | 34771b5 | 2009-09-14 04:33:21 +0000 | [diff] [blame] | 5 | void f0() { |
| 6 | printf("a\n"); |
| 7 | } |
| 8 | |
Rafael Espindola | 75d0f82 | 2010-06-16 17:49:52 +0000 | [diff] [blame] | 9 | // CHECK: call void @exit |
Daniel Dunbar | 34771b5 | 2009-09-14 04:33:21 +0000 | [diff] [blame] | 10 | // CHECK: unreachable |
| 11 | void f1() { |
| 12 | exit(1); |
| 13 | } |
Eli Friedman | c285372 | 2011-03-24 05:09:45 +0000 | [diff] [blame] | 14 | |
| 15 | // CHECK: call i8* @strstr{{.*}} nounwind |
| 16 | char* f2(char* a, char* b) { |
| 17 | return __builtin_strstr(a, b); |
| 18 | } |
Jakob Stoklund Olesen | 87198c3 | 2011-09-08 21:18:03 +0000 | [diff] [blame] | 19 | |
| 20 | // frexp is NOT readnone. It writes to its pointer argument. |
| 21 | // <rdar://problem/10070234> |
| 22 | // |
| 23 | // CHECK: f3 |
| 24 | // CHECK: call double @frexp(double % |
| 25 | // CHECK-NOT: readnone |
| 26 | // CHECK: call float @frexpf(float % |
| 27 | // CHECK-NOT: readnone |
| 28 | // CHECK: call double @frexpl(double % |
| 29 | // CHECK-NOT: readnone |
| 30 | // |
| 31 | // Same thing for modf and friends. |
| 32 | // |
| 33 | // CHECK: call double @modf(double % |
| 34 | // CHECK-NOT: readnone |
| 35 | // CHECK: call float @modff(float % |
| 36 | // CHECK-NOT: readnone |
| 37 | // CHECK: call double @modfl(double % |
| 38 | // CHECK-NOT: readnone |
| 39 | // |
| 40 | // CHECK: call double @remquo(double % |
| 41 | // CHECK-NOT: readnone |
| 42 | // CHECK: call float @remquof(float % |
| 43 | // CHECK-NOT: readnone |
| 44 | // CHECK: call double @remquol(double % |
| 45 | // CHECK-NOT: readnone |
| 46 | // CHECK: ret |
| 47 | int f3(double x) { |
| 48 | int e; |
| 49 | __builtin_frexp(x, &e); |
| 50 | __builtin_frexpf(x, &e); |
| 51 | __builtin_frexpl(x, &e); |
| 52 | __builtin_modf(x, &e); |
| 53 | __builtin_modff(x, &e); |
| 54 | __builtin_modfl(x, &e); |
| 55 | __builtin_remquo(x, x, &e); |
| 56 | __builtin_remquof(x, x, &e); |
| 57 | __builtin_remquol(x, x, &e); |
| 58 | return e; |
| 59 | } |