1 // RUN: %clang_cc1 -verify -triple powerpc64le-unknown-linux-gnu -fopenmp -x c -emit-llvm %s -o - | FileCheck %s
2
3 // RUN: %clang_cc1 -verify -triple powerpc64le-unknown-linux-gnu -fopenmp-simd -x c -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
4 // SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
5
6 int a;
7
8 // CHECK-LABEL: foo
foo()9 void foo() {
10 int(*b)[a];
11 int *(**c)[a];
12 // CHECK: [[B:%.+]] = alloca i32*,
13 // CHECK: [[C:%.+]] = alloca i32***,
14 // CHECK: @__kmpc_global_thread_num
15 // CHECK: call void @__kmpc_serialized_parallel
16 // CHECK: call void [[OUTLINED:@[^(]+]](i32* %{{[^,]+}}, i32* %{{[^,]+}}, i64 %{{[^,]+}}, i32** [[B]], i64 %{{[^,]+}}, i32**** [[C]])
17 // CHECK: call void @__kmpc_end_serialized_parallel
18 // CHECK: ret void
19 #pragma omp parallel if (0)
20 b[0][0] = c[0][a][0][a];
21 }
22
23 // CHECK: define internal void [[OUTLINED]](i32* {{[^,]+}}, i32* {{[^,]+}}, i64 {{[^,]+}}, i32** {{[^,]+}}, i64 {{[^,]+}}, i32**** {{[^,]+}})
24
25 // CHECK-LABEL: bar
bar(int n,int * a)26 void bar(int n, int *a) {
27 // CHECK: [[N:%.+]] = alloca i32,
28 // CHECK: [[A:%.+]] = alloca i32*,
29 // CHECK: [[P:%.+]] = alloca i32*,
30 // CHECK: @__kmpc_global_thread_num
31 // CHECK: [[BC:%.+]] = bitcast i32** [[A]] to i32*
32 // CHECK: store i32* [[BC]], i32** [[P]],
33 // CHECK: call void @__kmpc_serialized_parallel
34 // CHECK: call void [[OUTLINED:@[^(]+]](i32* %{{[^,]+}}, i32* %{{[^,]+}}, i64 %{{[^,]+}}, i32** [[P]], i32** [[A]])
35 // CHECK: call void @__kmpc_end_serialized_parallel
36 // CHECK: ret void
37 // expected-warning@+1 {{incompatible pointer types initializing 'int (*)[n]' with an expression of type 'int **'}}
38 int(*p)[n] = &a;
39 #pragma omp parallel if(0)
40 // expected-warning@+1 {{comparison of distinct pointer types ('int (*)[n]' and 'int **')}}
41 if (p == &a) {
42 }
43 }
44
45 // CHECK: define internal void [[OUTLINED]](i32* {{[^,]+}}, i32* {{[^,]+}}, i64 {{[^,]+}}, i32** {{[^,]+}}, i32** {{[^,]+}})
46