|
| 1 | +// XFAIL: * |
1 | 2 | // RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa \ |
2 | 3 | // RUN: -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx906 --no-opaque-offload-linker --libomptarget-amdgpu-bc-path=%S/Inputs/hip_dev_lib -nogpulib %s 2>&1 \ |
3 | 4 | // RUN: | FileCheck %s |
|
12 | 13 | // CHECK: clang-linker-wrapper{{.*}} "-o" "a.out" |
13 | 14 |
|
14 | 15 | // RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa \ |
15 | | -// RUN: -march=gfx906 %s 2>&1 | FileCheck --check-prefix=CHECK-PHASES %s |
| 16 | +// RUN: -march=gfx906 --no-opaque-offload-linker %s 2>&1 | FileCheck --check-prefix=CHECK-PHASES %s |
16 | 17 | // phases |
17 | 18 | // CHECK-PHASES: 0: input, "[[INPUT:.+]]", c, (host-openmp) |
18 | 19 | // CHECK-PHASES: 1: preprocessor, {0}, cpp-output, (host-openmp) |
19 | 20 | // CHECK-PHASES: 2: compiler, {1}, ir, (host-openmp) |
20 | | -// CHECK-PHASES: 3: input, "[[INPUT]]", c, (device-openmp, gfx906) |
21 | | -// CHECK-PHASES: 4: preprocessor, {3}, cpp-output, (device-openmp, gfx906) |
22 | | -// CHECK-PHASES: 5: compiler, {4}, ir, (device-openmp, gfx906) |
23 | | -// CHECK-PHASES: 6: offload, "host-openmp (x86_64-unknown-linux-gnu)" {2}, "device-openmp (amdgcn-amd-amdhsa:gfx906)" {5}, ir |
24 | | -// CHECK-PHASES: 7: backend, {6}, ir, (device-openmp, gfx906) |
25 | | -// CHECK-PHASES: 8: offload, "device-openmp (amdgcn-amd-amdhsa:gfx906)" {7}, ir |
| 21 | +// CHECK-PHASES: 3: input, "[[INPUT]]", c, (device-openmp) |
| 22 | +// CHECK-PHASES: 4: preprocessor, {3}, cpp-output, (device-openmp) |
| 23 | +// CHECK-PHASES: 5: compiler, {4}, ir, (device-openmp) |
| 24 | +// CHECK-PHASES: 6: offload, "host-openmp (x86_64-unknown-linux-gnu)" {2}, "device-openmp (amdgcn-amd-amdhsa)" {5}, ir |
| 25 | +// CHECK-PHASES: 7: backend, {6}, ir, (device-openmp) |
| 26 | +// CHECK-PHASES: 8: offload, "device-openmp (amdgcn-amd-amdhsa)" {7}, ir |
26 | 27 | // CHECK-PHASES: 9: clang-offload-packager, {8}, image, (device-openmp) |
27 | 28 | // CHECK-PHASES: 10: offload, "host-openmp (x86_64-unknown-linux-gnu)" {2}, "device-openmp (x86_64-unknown-linux-gnu)" {9}, ir |
28 | 29 | // CHECK-PHASES: 11: backend, {10}, assembler, (host-openmp) |
29 | 30 | // CHECK-PHASES: 12: assembler, {11}, object, (host-openmp) |
30 | 31 | // CHECK-PHASES: 13: clang-linker-wrapper, {12}, image, (host-openmp) |
31 | 32 |
|
32 | | -// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa \ |
33 | | -// RUN: -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx90a:xnack+ \ |
34 | | -// RUN: -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx90a:xnack- %s 2>&1 \ |
| 33 | +// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fopenmp \ |
| 34 | +// RUN: --offload-arch=gfx90a:xnack+ \ |
| 35 | +// RUN: --offload-arch=gfx90a:xnack- %s 2>&1 \ |
35 | 36 | // RUN: | FileCheck --check-prefix=CHECK-PHASES-MULTI %s |
36 | 37 |
|
37 | | -// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa \ |
38 | | -// RUN: -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx90a:xnack+,gfx90a:xnack- %s 2>&1 \ |
| 38 | +// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fopenmp \ |
| 39 | +// RUN: --offload-arch=gfx90a:xnack+,gfx90a:xnack- %s 2>&1 \ |
39 | 40 | // RUN: | FileCheck --check-prefix=CHECK-PHASES-MULTI %s |
40 | 41 |
|
41 | 42 | // CHECK-PHASES-MULTI: 0: input, "[[INPUT:.+]]", c, (host-openmp) |
|
59 | 60 | // CHECK-PHASES-MULTI: 18: assembler, {17}, object, (host-openmp) |
60 | 61 | // CHECK-PHASES-MULTI: 19: clang-linker-wrapper, {18}, image, (host-openmp) |
61 | 62 |
|
62 | | -// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-bindings -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-BINDINGS |
63 | | -// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-bindings -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa --offload-arch=gfx803 -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-BINDINGS |
| 63 | +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-bindings -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 --no-opaque-offload-linker -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-BINDINGS |
| 64 | +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-bindings -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa --offload-arch=gfx803 --no-opaque-offload-linker -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-BINDINGS |
64 | 65 | // CHECK-BINDINGS: "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[HOST_BC:.+]]" |
65 | 66 | // CHECK-BINDINGS: "amdgcn-amd-amdhsa" - "clang", inputs: ["[[INPUT]]", "[[HOST_BC]]"], output: "[[DEVICE_BC:.+]]" |
66 | 67 | // CHECK-BINDINGS: "x86_64-unknown-linux-gnu" - "Offload::Packager", inputs: ["[[DEVICE_BC]]"], output: "[[BINARY:.+]]" |
67 | 68 | // CHECK-BINDINGS: "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[HOST_BC]]", "[[BINARY]]"], output: "[[HOST_OBJ:.+]]" |
68 | 69 | // CHECK-BINDINGS: "x86_64-unknown-linux-gnu" - "Offload::Linker", inputs: ["[[HOST_OBJ]]"], output: "a.out" |
69 | 70 |
|
70 | | -// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-bindings -save-temps -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-BINDINGS-TEMPS |
71 | | -// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-bindings -save-temps -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa --offload-arch=gfx803 -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-BINDINGS-TEMPS |
| 71 | +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-bindings -save-temps -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 --no-opaque-offload-linker -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-BINDINGS-TEMPS |
| 72 | +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -ccc-print-bindings -save-temps -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa --offload-arch=gfx803 --no-opaque-offload-linker -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-BINDINGS-TEMPS |
72 | 73 | // CHECK-BINDINGS-TEMPS: "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[INPUT:.+]]"], output: "[[HOST_PP:.+]]" |
73 | 74 | // CHECK-BINDINGS-TEMPS: "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[HOST_PP]]"], output: "[[HOST_BC:.+]]" |
74 | 75 | // CHECK-BINDINGS-TEMPS: "amdgcn-amd-amdhsa" - "clang", inputs: ["[[INPUT]]"], output: "[[DEVICE_PP:.+]]" |
|
79 | 80 | // CHECK-BINDINGS-TEMPS: "x86_64-unknown-linux-gnu" - "clang::as", inputs: ["[[HOST_ASM]]"], output: "[[HOST_OBJ:.+]]" |
80 | 81 | // CHECK-BINDINGS-TEMPS: "x86_64-unknown-linux-gnu" - "Offload::Linker", inputs: ["[[HOST_OBJ]]"], output: "a.out" |
81 | 82 |
|
82 | | -// RUN: %clang -### --target=x86_64-unknown-linux-gnu -emit-llvm -S -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-EMIT-LLVM-IR |
| 83 | +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -emit-llvm -S -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 --no-opaque-offload-linker -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-EMIT-LLVM-IR |
83 | 84 | // CHECK-EMIT-LLVM-IR: "-cc1" "-triple" "amdgcn-amd-amdhsa"{{.*}}"-emit-llvm" |
84 | 85 |
|
85 | 86 | // RUN: %clang -### -target x86_64-pc-linux-gnu -fopenmp --offload-arch=gfx803 \ |
|
94 | 95 |
|
95 | 96 | // RUN: %clang -### -target x86_64-pc-linux-gnu -fopenmp --offload-arch=gfx90a:sramecc-:xnack+ \ |
96 | 97 | // RUN: -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-TARGET-ID |
97 | | -// CHECK-TARGET-ID: "-cc1" "-triple" "amdgcn-amd-amdhsa" {{.*}} "-target-cpu" "gfx90a:sramecc-:xnack+" "-target-feature" "-sramecc" "-target-feature" "+xnack" |
98 | | -// CHECK-TARGET-ID: clang-offload-packager{{.*}}arch=gfx90a:sramecc-:xnack+,kind=openmp,feature=-sramecc,feature=+xnack |
| 98 | +// CHECK-TARGET-ID: "-cc1" "-triple" "amdgcn-amd-amdhsa" {{.*}} "-target-cpu" "gfx90a" "-target-feature" "-sramecc" "-target-feature" "+xnack" |
| 99 | +// CHECK-TARGET-ID: clang-offload-packager{{.*}}arch=gfx90a:sramecc-:xnack+,kind=openmp |
99 | 100 |
|
100 | 101 | // RUN: not %clang -### -target x86_64-pc-linux-gnu -fopenmp --offload-arch=gfx90a,gfx90a:xnack+ \ |
101 | 102 | // RUN: -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-TARGET-ID-ERROR |
|
105 | 106 | // RUN: -O3 -nogpulib --no-opaque-offload-linker %s 2>&1 | FileCheck %s --check-prefix=CHECK-OPT |
106 | 107 | // CHECK-OPT: clang-linker-wrapper{{.*}}"--opt-level=O3" |
107 | 108 |
|
108 | | -// RUN: %clang -### --target=x86_64-unknown-linux-gnu -emit-llvm -S -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-WARN-ATOMIC |
| 109 | +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -emit-llvm -S -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 --no-opaque-offload-linker -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-WARN-ATOMIC |
109 | 110 | // CHECK-WARN-ATOMIC-NOT: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-Werror=atomic-alignment" |
110 | 111 | // CHECK-WARN-ATOMIC: "-cc1" "-triple" "amdgcn-amd-amdhsa"{{.*}}"-Werror=atomic-alignment" |
| 112 | + |
| 113 | +// RUN: %clang -### --target=x86_64-unknown-linux-gnu -emit-llvm -S -fopenmp --offload-arch=gfx803 \ |
| 114 | +// RUN: -stdlib=libc++ -nogpulib %s 2>&1 | FileCheck %s --check-prefix=LIBCXX |
| 115 | +// LIBCXX-NOT: include/amdgcn-amd-amdhsa/c++/v1 |
| 116 | + |
| 117 | +// RUN: %clang -### --save-temps -target x86_64-pc-linux-gnu -fopenmp --offload-arch=gfx90a:xnack+ -mamdgpu-precise-memory-op \ |
| 118 | +// RUN: -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-TARGET-FEATURES |
| 119 | +// CHECK-TARGET-FEATURES: clang-offload-packager{{.*}} "-o" {{.*}}.out" "--image=file={{.*}}.bc,triple=amdgcn-amd-amdhsa,arch=gfx90a:xnack+,kind=openmp" |
| 120 | +// CHECK-TARGET-FEATURES: clang-offload-packager"{{.*}}.o" "--image=file={{.*}}.bc,triple=amdgcn-amd-amdhsa,arch=gfx90a:xnack+,kind=openmp" |
| 121 | +// CHECK-TARGET-FEATURES: opt{{.*}} "-mtriple=amdgcn-amd-amdhsa" "-o" {{.*}}.bc" "-mcpu=gfx90a" "-mattr=+xnack,+precise-memory" |
| 122 | +// CHECK-TARGET-FEATURES: llc{{.*}} "-mtriple=amdgcn-amd-amdhsa" "-filetype=asm" "-o" {{.*}}.s" "{{.*}}.bc" "-mcpu=gfx90a" "-mattr=+xnack,+precise-memory" |
| 123 | +// CHECK-TARGET-FEATURES: llc{{.*}} "-mtriple=amdgcn-amd-amdhsa" "-filetype=obj" "-o" {{.*}}.o" "{{.*}}.bc" "-mcpu=gfx90a" "-mattr=+xnack,+precise-memory" |
| 124 | +// CHECK-TARGET-FEATURES: lld{{.*}} "-flavor" "gnu" "--no-undefined" "-shared" {{.*}}.o" "-plugin-opt=mcpu=gfx90a" "-plugin-opt=-mattr=+xnack,+precise-memory" "-o" {{.*}}.out" |
0 commit comments