xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/misaligned-param.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -triple i386-apple-darwin -emit-llvm -o - | FileCheck %s
2*f4a2713aSLionel Sambuc // Misaligned parameter must be memcpy'd to correctly aligned temporary.
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc struct s { int x; long double y; };
foo(struct s x,int i,struct s y)5*f4a2713aSLionel Sambuc long double foo(struct s x, int i, struct s y) {
6*f4a2713aSLionel Sambuc // CHECK: foo
7*f4a2713aSLionel Sambuc // CHECK: %x = alloca %struct.s, align 16
8*f4a2713aSLionel Sambuc // CHECK: %y = alloca %struct.s, align 16
9*f4a2713aSLionel Sambuc // CHECK: memcpy
10*f4a2713aSLionel Sambuc // CHECK: memcpy
11*f4a2713aSLionel Sambuc // CHECK: bar
12*f4a2713aSLionel Sambuc   return bar(&x, &y);
13*f4a2713aSLionel Sambuc }
14