Mercurial > hg > CbC > CbC_llvm
comparison clang/test/CodeGen/unaligned-struct-copy.c @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
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 | |
5 | |
6 struct S1 { | |
7 unsigned long x; | |
8 }; | |
9 | |
10 // CHECK: define | |
11 // CHECK-SAME: void | |
12 // CHECK-SAME: test1 | |
13 | |
14 void test1(__unaligned struct S1 *out) { | |
15 // CHECK: store | |
16 // CHECK-SAME: align 1 | |
17 out->x = 5; | |
18 // CHECK: ret void | |
19 } | |
20 | |
21 // CHECK: define | |
22 // CHECK-SAME: void | |
23 // CHECK-SAME: test2 | |
24 | |
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 | |
32 } |