1; RUN: not llc -mtriple=amdgcn-amd- -mcpu=gfx803 -verify-machineinstrs < %s 2>&1 | FileCheck %s
2; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -verify-machineinstrs < %s 2>&1 | FileCheck %s
3; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -verify-machineinstrs < %s 2>&1 | FileCheck %s
4
5; CHECK: error: <unknown>:0:0: in function invalid_fence void (): Unsupported atomic synchronization scope
6define amdgpu_kernel void @invalid_fence() {
7entry:
8  fence syncscope("invalid") seq_cst
9  ret void
10}
11
12; CHECK: error: <unknown>:0:0: in function invalid_load void (i32*, i32*): Unsupported non-inclusive atomic synchronization scope
13define amdgpu_kernel void @invalid_load(
14    i32* %in, i32* %out) {
15entry:
16  %val = load atomic i32, i32* %in syncscope("invalid") seq_cst, align 4
17  store i32 %val, i32* %out
18  ret void
19}
20
21; CHECK: error: <unknown>:0:0: in function invalid_store void (i32, i32*): Unsupported non-inclusive atomic synchronization scope
22define amdgpu_kernel void @invalid_store(
23    i32 %in, i32* %out) {
24entry:
25  store atomic i32 %in, i32* %out syncscope("invalid") seq_cst, align 4
26  ret void
27}
28
29; CHECK: error: <unknown>:0:0: in function invalid_cmpxchg void (i32*, i32, i32): Unsupported non-inclusive atomic synchronization scope
30define amdgpu_kernel void @invalid_cmpxchg(
31    i32* %out, i32 %in, i32 %old) {
32entry:
33  %gep = getelementptr i32, i32* %out, i32 4
34  %val = cmpxchg volatile i32* %gep, i32 %old, i32 %in syncscope("invalid") seq_cst seq_cst
35  ret void
36}
37
38; CHECK: error: <unknown>:0:0: in function invalid_rmw void (i32*, i32): Unsupported non-inclusive atomic synchronization scope
39define amdgpu_kernel void @invalid_rmw(
40    i32* %out, i32 %in) {
41entry:
42  %val = atomicrmw volatile xchg i32* %out, i32 %in syncscope("invalid") seq_cst
43  ret void
44}
45