|
| 1 | +// RUN: %clang_cc1 -x c++ -verify -fompss-2 -disable-llvm-passes -ferror-limit 100 %s -S -emit-llvm -o - | FileCheck %s |
| 2 | +// expected-no-diagnostics |
| 3 | + |
| 4 | +struct S { |
| 5 | + int x = 43; |
| 6 | + int y; |
| 7 | + void f(); |
| 8 | +}; |
| 9 | + |
| 10 | +void S::f() { |
| 11 | + #pragma oss task depend(out : x) |
| 12 | + {} |
| 13 | + #pragma oss task depend(in : this->x) |
| 14 | + {} |
| 15 | + #pragma oss task |
| 16 | + { x = 3; } |
| 17 | + #pragma oss task |
| 18 | + { this->x = 3; } |
| 19 | +} |
| 20 | + |
| 21 | +// CHECK: %this1 = load %struct.S*, %struct.S** %this.addr, align 8 |
| 22 | +// CHECK-NEXT: %x = getelementptr inbounds %struct.S, %struct.S* %this1, i32 0, i32 0 |
| 23 | +// CHECK-NEXT: %0 = call token @llvm.directive.region.entry() [ "DIR.OSS"([5 x i8] c"TASK\00"), "QUAL.OSS.SHARED"(%struct.S* %this1), "QUAL.OSS.DEP.OUT"(i32* %x, i64 4, i64 0, i64 4) ] |
| 24 | +// CHECK-NEXT: call void @llvm.directive.region.exit(token %0) |
| 25 | +// CHECK-NEXT: %x2 = getelementptr inbounds %struct.S, %struct.S* %this1, i32 0, i32 0 |
| 26 | +// CHECK-NEXT: %1 = call token @llvm.directive.region.entry() [ "DIR.OSS"([5 x i8] c"TASK\00"), "QUAL.OSS.SHARED"(%struct.S* %this1), "QUAL.OSS.DEP.IN"(i32* %x2, i64 4, i64 0, i64 4) ] |
| 27 | +// CHECK-NEXT: call void @llvm.directive.region.exit(token %1) |
| 28 | +// CHECK-NEXT: %2 = call token @llvm.directive.region.entry() [ "DIR.OSS"([5 x i8] c"TASK\00"), "QUAL.OSS.SHARED"(%struct.S* %this1) ] |
| 29 | +// CHECK-NEXT: %x3 = getelementptr inbounds %struct.S, %struct.S* %this1, i32 0, i32 0 |
| 30 | +// CHECK-NEXT: store i32 3, i32* %x3, align 4 |
| 31 | +// CHECK-NEXT: call void @llvm.directive.region.exit(token %2) |
| 32 | +// CHECK-NEXT: %3 = call token @llvm.directive.region.entry() [ "DIR.OSS"([5 x i8] c"TASK\00"), "QUAL.OSS.SHARED"(%struct.S* %this1) ] |
| 33 | +// CHECK-NEXT: %x4 = getelementptr inbounds %struct.S, %struct.S* %this1, i32 0, i32 0 |
| 34 | +// CHECK-NEXT: store i32 3, i32* %x4, align 4 |
| 35 | +// CHECK-NEXT: call void @llvm.directive.region.exit(token %3) |
| 36 | + |
0 commit comments