brintos

brintos / llvm-project-archived public Read only

0
0
Text · 931 B · b36fe90 Raw
28 lines · c
1// RUN: %clang_cc1 -triple sparc-unknown-unknown -emit-llvm -o - %s | FileCheck %s2 3// Ensure that we pass proper alignment to llvm in the call4// instruction. The proper alignment for the type is sometimes known5// only by clang, and is not manifest in the LLVM-type. So, it must be6// explicitly passed through. (Besides the case of the user specifying7// alignment, as here, this situation also occurrs for non-POD C++8// structs with tail-padding: clang emits these as packed llvm-structs9// for ABI reasons.)10 11struct s1 {12  int x;13} __attribute__((aligned(8)));14 15struct s1 x1;16 17 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 it22// CHECK: declare void @f1_helper(ptr noundef byval(%struct.s1) align 8)23 24void f1_helper(struct s1);25void f1(void) {26  f1_helper(x1);27}28