[LLVM][IR] Use splat syntax when printing ConstantExpr based splats. (#116856)
[llvm-project.git] / clang / test / CodeGen / unaligned-struct-copy.c
blob45a9670bc234731848bdb6cb6524f1c87b4e2d13
1 // RUN: %clang_cc1 -xc -O2 -triple thumbv7a-unknown-windows-eabi -fms-extensions -emit-llvm < %s | FileCheck %s
2 // RUN: %clang_cc1 -xc++ -O2 -triple thumbv7a-unknown-windows-eabi -fms-extensions -emit-llvm < %s | FileCheck %s
3 // RUN: %clang_cc1 -xc -O2 -triple x86_64-unknown-linux-gnu -fms-extensions -emit-llvm < %s | FileCheck %s
4 // RUN: %clang_cc1 -xc++ -O2 -triple x86_64-unknown-linux-gnu -fms-extensions -emit-llvm < %s | FileCheck %s
6 struct S1 {
7 unsigned long x;
8 };
10 // CHECK: define
11 // CHECK-SAME: void
12 // CHECK-SAME: test1
14 void test1(__unaligned struct S1 *out) {
15 // CHECK: store
16 // CHECK-SAME: align 1
17 out->x = 5;
18 // CHECK: ret void
21 // CHECK: define
22 // CHECK-SAME: void
23 // CHECK-SAME: test2
25 void test2(__unaligned struct S1 *out, __unaligned struct S1 *in) {
26 // CHECK: load
27 // CHECK-SAME: align 1
28 // CHECK: store
29 // CHECK-SAME: align 1
30 *out = *in;
31 // CHECK: ret void