1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -O0 -emit-llvm -o - %s | FileCheck %s
5 void test_small(void) {
6 // CHECK-LABEL: define{{.*}} void @test_small()
7 int a
[] = {1, 2, 3, 4};
8 // CHECK: call void @llvm.memcpy.{{.*}}
12 void test_small_same(void) {
13 // CHECK-LABEL: define{{.*}} void @test_small_same()
14 char a
[] = {'a', 'a', 'a', 'a'};
15 // CHECK: call void @llvm.memcpy.{{.*}}
19 void test_different(void) {
20 // CHECK-LABEL: define{{.*}} void @test_different()
21 int a
[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
22 // CHECK: call void @llvm.memcpy.{{.*}}
26 void test_all_zeros(void) {
27 // CHECK-LABEL: define{{.*}} void @test_all_zeros()
29 // CHECK: call void @llvm.memset.{{.*}}
33 void test_all_a(void) {
34 // CHECK-LABEL: define{{.*}} void @test_all_a()
35 char a
[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
36 // CHECK: call void @llvm.memcpy.{{.*}}
40 void test_most_zeros(void) {
41 // CHECK-LABEL: define{{.*}} void @test_most_zeros()
42 int a
[16] = {0, 0, 1};
43 // CHECK: call void @llvm.memset.{{.*}}
48 void test_most_a(void) {
49 // CHECK-LABEL: define{{.*}} void @test_most_a()
50 char a
[] = "aaaaazaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
51 // CHECK: call void @llvm.memcpy.{{.*}}
55 void test_pointers(void) {
56 // CHECK-LABEL: define{{.*}} void @test_pointers()
57 void *a
[] = {&use
, &use
, &use
, &use
, &use
, &use
};
58 // CHECK: call void @llvm.memcpy.{{.*}}