62 lines · cpp
1// RUN: %clang_cc1 -emit-llvm -o - -fopenmp \2// RUN: -triple i386-unknown-unknown %s \3// RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-324 5// RUN: %clang_cc1 -emit-llvm -o - -fopenmp \6// RUN: -triple x86_64-unknown-linux-gnu %s \7// RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-648 9typedef enum omp_allocator_handle_t {10 omp_null_allocator = 0,11 omp_default_mem_alloc = 1,12 omp_large_cap_mem_alloc = 2,13 omp_const_mem_alloc = 3,14 omp_high_bw_mem_alloc = 4,15 omp_low_lat_mem_alloc = 5,16 omp_cgroup_mem_alloc = 6,17 omp_pteam_mem_alloc = 7,18 omp_thread_mem_alloc = 8,19 KMP_ALLOCATOR_MAX_HANDLE = __UINTPTR_MAX__20} omp_allocator_handle_t;21 22//23// Should allow larger alignment.24//25 26// CHECK: @foo_global1 = global float 0.000000e+00, align 1627float foo_global1;28#pragma omp allocate(foo_global1) align(16)29 30// CHECK: @foo_global2 = global float 0.000000e+00, align 1631float foo_global2;32#pragma omp allocate(foo_global2) allocator(omp_default_mem_alloc) align(16)33 34// CHECK: @foo_global3 = global float 0.000000e+00, align 1635float foo_global3;36#pragma omp allocate(foo_global3) allocator(omp_large_cap_mem_alloc) align(16)37 38// CHECK: @foop_global1 = global ptr null, align 1639int *foop_global1;40#pragma omp allocate(foop_global1) align(16)41 42//43// Should use natural alignment when alignment specified is too small.44//45 46// CHECK: @foo_global4 = global float 0.000000e+00, align 447float foo_global4;48#pragma omp allocate(foo_global4) align(2)49 50// CHECK: @foo_global5 = global float 0.000000e+00, align 451float foo_global5;52#pragma omp allocate(foo_global5) allocator(omp_default_mem_alloc) align(2)53 54// CHECK: @foo_global6 = global float 0.000000e+00, align 455float foo_global6;56#pragma omp allocate(foo_global6) allocator(omp_large_cap_mem_alloc) align(2)57 58// CHECK-32: @foop_global2 = global ptr null, align 459// CHECK-64: @foop_global2 = global ptr null, align 860int *foop_global2;61#pragma omp allocate(foop_global2) align(2)62