| 1 |
// Check that -mcpu works for all supported GPUs. |
| 2 |
|
| 3 |
// |
| 4 |
// R600-based processors. |
| 5 |
// |
| 6 |
|
| 7 |
// RUN: %clang -### -target r600 -mcpu=r600 %s 2>&1 | FileCheck --check-prefix=R600 %s |
| 8 |
// RUN: %clang -### -target r600 -mcpu=rv630 %s 2>&1 | FileCheck --check-prefix=R600 %s |
| 9 |
// RUN: %clang -### -target r600 -mcpu=rv635 %s 2>&1 | FileCheck --check-prefix=R600 %s |
| 10 |
// RUN: %clang -### -target r600 -mcpu=r630 %s 2>&1 | FileCheck --check-prefix=R630 %s |
| 11 |
// RUN: %clang -### -target r600 -mcpu=rs780 %s 2>&1 | FileCheck --check-prefix=RS880 %s |
| 12 |
// RUN: %clang -### -target r600 -mcpu=rs880 %s 2>&1 | FileCheck --check-prefix=RS880 %s |
| 13 |
// RUN: %clang -### -target r600 -mcpu=rv610 %s 2>&1 | FileCheck --check-prefix=RS880 %s |
| 14 |
// RUN: %clang -### -target r600 -mcpu=rv620 %s 2>&1 | FileCheck --check-prefix=RS880 %s |
| 15 |
// RUN: %clang -### -target r600 -mcpu=rv670 %s 2>&1 | FileCheck --check-prefix=RV670 %s |
| 16 |
// RUN: %clang -### -target r600 -mcpu=rv710 %s 2>&1 | FileCheck --check-prefix=RV710 %s |
| 17 |
// RUN: %clang -### -target r600 -mcpu=rv730 %s 2>&1 | FileCheck --check-prefix=RV730 %s |
| 18 |
// RUN: %clang -### -target r600 -mcpu=rv740 %s 2>&1 | FileCheck --check-prefix=RV770 %s |
| 19 |
// RUN: %clang -### -target r600 -mcpu=rv770 %s 2>&1 | FileCheck --check-prefix=RV770 %s |
| 20 |
// RUN: %clang -### -target r600 -mcpu=cedar %s 2>&1 | FileCheck --check-prefix=CEDAR %s |
| 21 |
// RUN: %clang -### -target r600 -mcpu=palm %s 2>&1 | FileCheck --check-prefix=CEDAR %s |
| 22 |
// RUN: %clang -### -target r600 -mcpu=cypress %s 2>&1 | FileCheck --check-prefix=CYPRESS %s |
| 23 |
// RUN: %clang -### -target r600 -mcpu=hemlock %s 2>&1 | FileCheck --check-prefix=CYPRESS %s |
| 24 |
// RUN: %clang -### -target r600 -mcpu=juniper %s 2>&1 | FileCheck --check-prefix=JUNIPER %s |
| 25 |
// RUN: %clang -### -target r600 -mcpu=redwood %s 2>&1 | FileCheck --check-prefix=REDWOOD %s |
| 26 |
// RUN: %clang -### -target r600 -mcpu=sumo %s 2>&1 | FileCheck --check-prefix=SUMO %s |
| 27 |
// RUN: %clang -### -target r600 -mcpu=sumo2 %s 2>&1 | FileCheck --check-prefix=SUMO %s |
| 28 |
// RUN: %clang -### -target r600 -mcpu=barts %s 2>&1 | FileCheck --check-prefix=BARTS %s |
| 29 |
// RUN: %clang -### -target r600 -mcpu=caicos %s 2>&1 | FileCheck --check-prefix=CAICOS %s |
| 30 |
// RUN: %clang -### -target r600 -mcpu=aruba %s 2>&1 | FileCheck --check-prefix=CAYMAN %s |
| 31 |
// RUN: %clang -### -target r600 -mcpu=cayman %s 2>&1 | FileCheck --check-prefix=CAYMAN %s |
| 32 |
// RUN: %clang -### -target r600 -mcpu=turks %s 2>&1 | FileCheck --check-prefix=TURKS %s |
| 33 |
|
| 34 |
// R600: "-target-cpu" "r600" |
| 35 |
// R630: "-target-cpu" "r630" |
| 36 |
// RS880: "-target-cpu" "rs880" |
| 37 |
// RV670: "-target-cpu" "rv670" |
| 38 |
// RV710: "-target-cpu" "rv710" |
| 39 |
// RV730: "-target-cpu" "rv730" |
| 40 |
// RV770: "-target-cpu" "rv770" |
| 41 |
// CEDAR: "-target-cpu" "cedar" |
| 42 |
// CYPRESS: "-target-cpu" "cypress" |
| 43 |
// JUNIPER: "-target-cpu" "juniper" |
| 44 |
// REDWOOD: "-target-cpu" "redwood" |
| 45 |
// SUMO: "-target-cpu" "sumo" |
| 46 |
// BARTS: "-target-cpu" "barts" |
| 47 |
// CAICOS: "-target-cpu" "caicos" |
| 48 |
// CAYMAN: "-target-cpu" "cayman" |
| 49 |
// TURKS: "-target-cpu" "turks" |
| 50 |
|
| 51 |
// |
| 52 |
// AMDGCN-based processors. |
| 53 |
// |
| 54 |
|
| 55 |
// RUN: %clang -### -target amdgcn %s 2>&1 | FileCheck --check-prefix=GCNDEFAULT %s |
| 56 |
// RUN: %clang -### -target amdgcn -mcpu=gfx600 %s 2>&1 | FileCheck --check-prefix=GFX600 %s |
| 57 |
// RUN: %clang -### -target amdgcn -mcpu=tahiti %s 2>&1 | FileCheck --check-prefix=GFX600 %s |
| 58 |
// RUN: %clang -### -target amdgcn -mcpu=gfx601 %s 2>&1 | FileCheck --check-prefix=GFX601 %s |
| 59 |
// RUN: %clang -### -target amdgcn -mcpu=pitcairn %s 2>&1 | FileCheck --check-prefix=GFX601 %s |
| 60 |
// RUN: %clang -### -target amdgcn -mcpu=verde %s 2>&1 | FileCheck --check-prefix=GFX601 %s |
| 61 |
// RUN: %clang -### -target amdgcn -mcpu=gfx602 %s 2>&1 | FileCheck --check-prefix=GFX602 %s |
| 62 |
// RUN: %clang -### -target amdgcn -mcpu=hainan %s 2>&1 | FileCheck --check-prefix=GFX602 %s |
| 63 |
// RUN: %clang -### -target amdgcn -mcpu=oland %s 2>&1 | FileCheck --check-prefix=GFX602 %s |
| 64 |
// RUN: %clang -### -target amdgcn -mcpu=gfx700 %s 2>&1 | FileCheck --check-prefix=GFX700 %s |
| 65 |
// RUN: %clang -### -target amdgcn -mcpu=kaveri %s 2>&1 | FileCheck --check-prefix=GFX700 %s |
| 66 |
// RUN: %clang -### -target amdgcn -mcpu=gfx701 %s 2>&1 | FileCheck --check-prefix=GFX701 %s |
| 67 |
// RUN: %clang -### -target amdgcn -mcpu=hawaii %s 2>&1 | FileCheck --check-prefix=GFX701 %s |
| 68 |
// RUN: %clang -### -target amdgcn -mcpu=gfx702 %s 2>&1 | FileCheck --check-prefix=GFX702 %s |
| 69 |
// RUN: %clang -### -target amdgcn -mcpu=gfx703 %s 2>&1 | FileCheck --check-prefix=GFX703 %s |
| 70 |
// RUN: %clang -### -target amdgcn -mcpu=kabini %s 2>&1 | FileCheck --check-prefix=GFX703 %s |
| 71 |
// RUN: %clang -### -target amdgcn -mcpu=mullins %s 2>&1 | FileCheck --check-prefix=GFX703 %s |
| 72 |
// RUN: %clang -### -target amdgcn -mcpu=gfx704 %s 2>&1 | FileCheck --check-prefix=GFX704 %s |
| 73 |
// RUN: %clang -### -target amdgcn -mcpu=bonaire %s 2>&1 | FileCheck --check-prefix=GFX704 %s |
| 74 |
// RUN: %clang -### -target amdgcn -mcpu=gfx705 %s 2>&1 | FileCheck --check-prefix=GFX705 %s |
| 75 |
// RUN: %clang -### -target amdgcn -mcpu=gfx801 %s 2>&1 | FileCheck --check-prefix=GFX801 %s |
| 76 |
// RUN: %clang -### -target amdgcn -mcpu=carrizo %s 2>&1 | FileCheck --check-prefix=GFX801 %s |
| 77 |
// RUN: %clang -### -target amdgcn -mcpu=gfx802 %s 2>&1 | FileCheck --check-prefix=GFX802 %s |
| 78 |
// RUN: %clang -### -target amdgcn -mcpu=iceland %s 2>&1 | FileCheck --check-prefix=GFX802 %s |
| 79 |
// RUN: %clang -### -target amdgcn -mcpu=tonga %s 2>&1 | FileCheck --check-prefix=GFX802 %s |
| 80 |
// RUN: %clang -### -target amdgcn -mcpu=gfx803 %s 2>&1 | FileCheck --check-prefix=GFX803 %s |
| 81 |
// RUN: %clang -### -target amdgcn -mcpu=fiji %s 2>&1 | FileCheck --check-prefix=GFX803 %s |
| 82 |
// RUN: %clang -### -target amdgcn -mcpu=polaris10 %s 2>&1 | FileCheck --check-prefix=GFX803 %s |
| 83 |
// RUN: %clang -### -target amdgcn -mcpu=polaris11 %s 2>&1 | FileCheck --check-prefix=GFX803 %s |
| 84 |
// RUN: %clang -### -target amdgcn -mcpu=gfx805 %s 2>&1 | FileCheck --check-prefix=GFX805 %s |
| 85 |
// RUN: %clang -### -target amdgcn -mcpu=gfx810 %s 2>&1 | FileCheck --check-prefix=GFX810 %s |
| 86 |
// RUN: %clang -### -target amdgcn -mcpu=stoney %s 2>&1 | FileCheck --check-prefix=GFX810 %s |
| 87 |
// RUN: %clang -### -target amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck --check-prefix=GFX900 %s |
| 88 |
// RUN: %clang -### -target amdgcn -mcpu=gfx902 %s 2>&1 | FileCheck --check-prefix=GFX902 %s |
| 89 |
// RUN: %clang -### -target amdgcn -mcpu=gfx904 %s 2>&1 | FileCheck --check-prefix=GFX904 %s |
| 90 |
// RUN: %clang -### -target amdgcn -mcpu=gfx906 %s 2>&1 | FileCheck --check-prefix=GFX906 %s |
| 91 |
// RUN: %clang -### -target amdgcn -mcpu=gfx908 %s 2>&1 | FileCheck --check-prefix=GFX908 %s |
| 92 |
// RUN: %clang -### -target amdgcn -mcpu=gfx909 %s 2>&1 | FileCheck --check-prefix=GFX909 %s |
| 93 |
// RUN: %clang -### -target amdgcn -mcpu=gfx90a %s 2>&1 | FileCheck --check-prefix=GFX90A %s |
| 94 |
// RUN: %clang -### -target amdgcn -mcpu=gfx90c %s 2>&1 | FileCheck --check-prefix=GFX90C %s |
| 95 |
// RUN: %clang -### -target amdgcn -mcpu=gfx942 %s 2>&1 | FileCheck --check-prefix=GFX942 %s |
| 96 |
// RUN: %clang -### -target amdgcn -mcpu=gfx950 %s 2>&1 | FileCheck --check-prefix=GFX950 %s |
| 97 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefix=GFX1010 %s |
| 98 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1011 %s 2>&1 | FileCheck --check-prefix=GFX1011 %s |
| 99 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1012 %s 2>&1 | FileCheck --check-prefix=GFX1012 %s |
| 100 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1013 %s 2>&1 | FileCheck --check-prefix=GFX1013 %s |
| 101 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1030 %s 2>&1 | FileCheck --check-prefix=GFX1030 %s |
| 102 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1031 %s 2>&1 | FileCheck --check-prefix=GFX1031 %s |
| 103 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1032 %s 2>&1 | FileCheck --check-prefix=GFX1032 %s |
| 104 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1033 %s 2>&1 | FileCheck --check-prefix=GFX1033 %s |
| 105 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1034 %s 2>&1 | FileCheck --check-prefix=GFX1034 %s |
| 106 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1035 %s 2>&1 | FileCheck --check-prefix=GFX1035 %s |
| 107 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1036 %s 2>&1 | FileCheck --check-prefix=GFX1036 %s |
| 108 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1100 %s 2>&1 | FileCheck --check-prefix=GFX1100 %s |
| 109 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1101 %s 2>&1 | FileCheck --check-prefix=GFX1101 %s |
| 110 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1102 %s 2>&1 | FileCheck --check-prefix=GFX1102 %s |
| 111 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1103 %s 2>&1 | FileCheck --check-prefix=GFX1103 %s |
| 112 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1150 %s 2>&1 | FileCheck --check-prefix=GFX1150 %s |
| 113 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1151 %s 2>&1 | FileCheck --check-prefix=GFX1151 %s |
| 114 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1152 %s 2>&1 | FileCheck --check-prefix=GFX1152 %s |
| 115 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1153 %s 2>&1 | FileCheck --check-prefix=GFX1153 %s |
| 116 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1200 %s 2>&1 | FileCheck --check-prefix=GFX1200 %s |
| 117 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1201 %s 2>&1 | FileCheck --check-prefix=GFX1201 %s |
| 118 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1250 %s 2>&1 | FileCheck --check-prefix=GFX1250 %s |
| 119 |
// RUN: %clang -### -target amdgcn -mcpu=gfx1251 %s 2>&1 | FileCheck --check-prefix=GFX1251 %s |
| 120 |
|
| 121 |
// RUN: %clang -### -target amdgcn -mcpu=gfx9-generic %s 2>&1 | FileCheck --check-prefix=GFX9_GENERIC %s |
| 122 |
// RUN: %clang -### -target amdgcn -mcpu=gfx9-4-generic %s 2>&1 | FileCheck --check-prefix=GFX9_4_GENERIC %s |
| 123 |
// RUN: %clang -### -target amdgcn -mcpu=gfx10-1-generic %s 2>&1 | FileCheck --check-prefix=GFX10_1_GENERIC %s |
| 124 |
// RUN: %clang -### -target amdgcn -mcpu=gfx10-3-generic %s 2>&1 | FileCheck --check-prefix=GFX10_3_GENERIC %s |
| 125 |
// RUN: %clang -### -target amdgcn -mcpu=gfx11-generic %s 2>&1 | FileCheck --check-prefix=GFX11_GENERIC %s |
| 126 |
// RUN: %clang -### -target amdgcn -mcpu=gfx12-generic %s 2>&1 | FileCheck --check-prefix=GFX12_GENERIC %s |
| 127 |
|
| 128 |
// GCNDEFAULT-NOT: -target-cpu |
| 129 |
// GFX600: "-target-cpu" "gfx600" |
| 130 |
// GFX601: "-target-cpu" "gfx601" |
| 131 |
// GFX602: "-target-cpu" "gfx602" |
| 132 |
// GFX700: "-target-cpu" "gfx700" |
| 133 |
// GFX701: "-target-cpu" "gfx701" |
| 134 |
// GFX702: "-target-cpu" "gfx702" |
| 135 |
// GFX703: "-target-cpu" "gfx703" |
| 136 |
// GFX704: "-target-cpu" "gfx704" |
| 137 |
// GFX705: "-target-cpu" "gfx705" |
| 138 |
// GFX801: "-target-cpu" "gfx801" |
| 139 |
// GFX802: "-target-cpu" "gfx802" |
| 140 |
// GFX803: "-target-cpu" "gfx803" |
| 141 |
// GFX805: "-target-cpu" "gfx805" |
| 142 |
// GFX810: "-target-cpu" "gfx810" |
| 143 |
// GFX900: "-target-cpu" "gfx900" |
| 144 |
// GFX902: "-target-cpu" "gfx902" |
| 145 |
// GFX904: "-target-cpu" "gfx904" |
| 146 |
// GFX906: "-target-cpu" "gfx906" |
| 147 |
// GFX908: "-target-cpu" "gfx908" |
| 148 |
// GFX909: "-target-cpu" "gfx909" |
| 149 |
// GFX90A: "-target-cpu" "gfx90a" |
| 150 |
// GFX90C: "-target-cpu" "gfx90c" |
| 151 |
// GFX942: "-target-cpu" "gfx942" |
| 152 |
// GFX950: "-target-cpu" "gfx950" |
| 153 |
// GFX1010: "-target-cpu" "gfx1010" |
| 154 |
// GFX1011: "-target-cpu" "gfx1011" |
| 155 |
// GFX1012: "-target-cpu" "gfx1012" |
| 156 |
// GFX1013: "-target-cpu" "gfx1013" |
| 157 |
// GFX1030: "-target-cpu" "gfx1030" |
| 158 |
// GFX1031: "-target-cpu" "gfx1031" |
| 159 |
// GFX1032: "-target-cpu" "gfx1032" |
| 160 |
// GFX1033: "-target-cpu" "gfx1033" |
| 161 |
// GFX1034: "-target-cpu" "gfx1034" |
| 162 |
// GFX1035: "-target-cpu" "gfx1035" |
| 163 |
// GFX1036: "-target-cpu" "gfx1036" |
| 164 |
// GFX1100: "-target-cpu" "gfx1100" |
| 165 |
// GFX1101: "-target-cpu" "gfx1101" |
| 166 |
// GFX1102: "-target-cpu" "gfx1102" |
| 167 |
// GFX1103: "-target-cpu" "gfx1103" |
| 168 |
// GFX1150: "-target-cpu" "gfx1150" |
| 169 |
// GFX1151: "-target-cpu" "gfx1151" |
| 170 |
// GFX1152: "-target-cpu" "gfx1152" |
| 171 |
// GFX1153: "-target-cpu" "gfx1153" |
| 172 |
// GFX1200: "-target-cpu" "gfx1200" |
| 173 |
// GFX1201: "-target-cpu" "gfx1201" |
| 174 |
// GFX1250: "-target-cpu" "gfx1250" |
| 175 |
// GFX1251: "-target-cpu" "gfx1251" |
| 176 |
|
| 177 |
// GFX9_GENERIC: "-target-cpu" "gfx9-generic" |
| 178 |
// GFX9_4_GENERIC: "-target-cpu" "gfx9-4-generic" |
| 179 |
// GFX10_1_GENERIC: "-target-cpu" "gfx10-1-generic" |
| 180 |
// GFX10_3_GENERIC: "-target-cpu" "gfx10-3-generic" |
| 181 |
// GFX11_GENERIC: "-target-cpu" "gfx11-generic" |
| 182 |
// GFX12_GENERIC: "-target-cpu" "gfx12-generic" |