Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / sparc-arguments.c
blobb36fe9078279bf0aec346b9c544ecd17c8a10ccc
1 // RUN: %clang_cc1 -triple sparc-unknown-unknown -emit-llvm -o - %s | FileCheck %s
3 // Ensure that we pass proper alignment to llvm in the call
4 // instruction. The proper alignment for the type is sometimes known
5 // only by clang, and is not manifest in the LLVM-type. So, it must be
6 // explicitly passed through. (Besides the case of the user specifying
7 // alignment, as here, this situation also occurrs for non-POD C++
8 // structs with tail-padding: clang emits these as packed llvm-structs
9 // for ABI reasons.)
11 struct s1 {
12 int x;
13 } __attribute__((aligned(8)));
15 struct s1 x1;
18 // Ensure the align 8 is passed through:
19 // CHECK-LABEL: define{{.*}} void @f1()
20 // CHECK: call void @f1_helper(ptr noundef byval(%struct.s1) align 8 @x1)
21 // Also ensure the declaration of f1_helper includes it
22 // CHECK: declare void @f1_helper(ptr noundef byval(%struct.s1) align 8)
24 void f1_helper(struct s1);
25 void f1(void) {
26 f1_helper(x1);