Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenOpenCL / kernel-param-alignment.cl
blob1bce77043981e570ad6af3a9b0f664548dcefc28
1 // RUN: %clang_cc1 %s -cl-std=CL1.2 -emit-llvm -triple x86_64-unknown-unknown -o - | FileCheck %s
3 // Test that pointer arguments to kernels are assumed to be ABI aligned.
5 struct __attribute__((packed, aligned(1))) packed {
6 int i32;
7 };
9 typedef __attribute__((ext_vector_type(4))) int int4;
10 typedef __attribute__((ext_vector_type(2))) float float2;
12 kernel void test(
13 global int *i32,
14 global long *i64,
15 global int4 *v4i32,
16 global float2 *v2f32,
17 global void *v,
18 global struct packed *p) {
19 // CHECK-LABEL: spir_kernel void @test(
20 // CHECK-SAME: ptr nocapture noundef readnone align 4 %i32,
21 // CHECK-SAME: ptr nocapture noundef readnone align 8 %i64,
22 // CHECK-SAME: ptr nocapture noundef readnone align 16 %v4i32,
23 // CHECK-SAME: ptr nocapture noundef readnone align 8 %v2f32,
24 // CHECK-SAME: ptr nocapture noundef readnone %v,
25 // CHECK-SAME: ptr nocapture noundef readnone align 1 %p)