1 // RUN: %clang_cc1 -emit-llvm -fms-extensions -o - %s | FileCheck %s
3 typedef typeof(sizeof(0)) size_t;
6 void *memset(void *s
, int c
, size_t n
);
7 void *memcpy(void *d
, const void *s
, size_t n
);
9 // CHECK: define{{.*}} void @foo1({{.*}}) #[[NO_NOBUILTIN:[0-9]+]]
10 void foo1(char *s
, char *d
, size_t n
) {
16 #pragma function(strlen, memset)
18 // CHECK: define{{.*}} void @foo2({{.*}}) #[[NOBUILTIN_MEMSET:[0-9]+]]
19 void foo2(char *s
, char *d
, size_t n
) {
25 #pragma function(memcpy)
27 // CHECK: define{{.*}} void @foo3({{.*}}) #[[NOBUILTIN_MEMSET_MEMCPY:[0-9]+]]
28 void foo3(char *s
, char *d
, size_t n
) {
34 // CHECK-NOT: attributes #[[NO_NOBUILTIN]] = {{{.*}}"no-builtin-memset"{{.*}}}
35 // CHECK-NOT: attributes #[[NO_NOBUILTIN]] = {{{.*}}"no-builtin-memcpy"{{.*}}"no-builtin-memset"{{.*}}}
36 // CHECK: attributes #[[NOBUILTIN_MEMSET]] = {{{.*}}"no-builtin-memset"{{.*}}}
37 // CHECK-NOT: attributes #[[NOBUILTIN_MEMSET]] = {{{.*}}"no-builtin-memcpy"{{.*}}"no-builtin-memset"{{.*}}}
38 // CHECK: attributes #[[NOBUILTIN_MEMSET_MEMCPY]] = {{{.*}}"no-builtin-memcpy"{{.*}}"no-builtin-memset"{{.*}}}