56 lines · c
1// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir2// RUN: FileCheck --input-file=%t.cir %s3 4// Note: In the final implementation, we will want these to generate5// CIR-specific libc operations. This test is just a placeholder6// to make sure we can compile these to normal function calls7// until the special handling is implemented.8 9void *memcpy(void *, const void *, unsigned long);10void testMemcpy(void *dst, const void *src, unsigned long size) {11 memcpy(dst, src, size);12 // CHECK: cir.call @memcpy13}14 15void *memmove(void *, const void *, unsigned long);16void testMemmove(void *src, const void *dst, unsigned long size) {17 memmove(dst, src, size);18 // CHECK: cir.call @memmove19}20 21void *memset(void *, int, unsigned long);22void testMemset(void *dst, int val, unsigned long size) {23 memset(dst, val, size);24 // CHECK: cir.call @memset25}26 27double fabs(double);28double testFabs(double x) {29 return fabs(x);30 // CHECK: cir.call @fabs31}32 33float fabsf(float);34float testFabsf(float x) {35 return fabsf(x);36 // CHECK: cir.call @fabsf37}38 39int abs(int);40int testAbs(int x) {41 return abs(x);42 // CHECK: cir.call @abs43}44 45long labs(long);46long testLabs(long x) {47 return labs(x);48 // CHECK: cir.call @labs49}50 51long long llabs(long long);52long long testLlabs(long long x) {53 return llabs(x);54 // CHECK: cir.call @llabs55}56