Mon P Wang | 3ecd785 | 2010-04-04 03:10:52 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm < %s| FileCheck %s |
Daniel Dunbar | 1caae95 | 2008-07-22 00:26:45 +0000 | [diff] [blame] | 2 | |
Mon P Wang | 3ecd785 | 2010-04-04 03:10:52 +0000 | [diff] [blame^] | 3 | // CHECK: call void @llvm.memset.p0i8.i32 |
| 4 | // CHECK: call void @llvm.memset.p0i8.i32 |
| 5 | // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32 |
| 6 | // CHECK: call void @llvm.memmove.p0i8.p0i8.i32 |
| 7 | // CHECK-NOT: __builtin |
| 8 | // CHECK: ret |
Daniel Dunbar | 1caae95 | 2008-07-22 00:26:45 +0000 | [diff] [blame] | 9 | int main(int argc, char **argv) { |
| 10 | unsigned char a = 0x11223344; |
| 11 | unsigned char b = 0x11223344; |
| 12 | __builtin_bzero(&a, sizeof(a)); |
| 13 | __builtin_memset(&a, 0, sizeof(a)); |
| 14 | __builtin_memcpy(&a, &b, sizeof(a)); |
| 15 | __builtin_memmove(&a, &b, sizeof(a)); |
| 16 | return 0; |
| 17 | } |