Home | History | Annotate | Download | only in ThreadSanitizer
      1 ; RUN: opt < %s -tsan -S | FileCheck %s
      2 ; Check that atomic memory operations are converted to calls into ThreadSanitizer runtime.
      3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
      4 
      5 define i8 @atomic8_load_unordered(i8* %a) nounwind uwtable {
      6 entry:
      7   %0 = load atomic i8, i8* %a unordered, align 1, !dbg !7
      8   ret i8 %0, !dbg !7
      9 }
     10 ; CHECK-LABEL: atomic8_load_unordered
     11 ; CHECK: call i8 @__tsan_atomic8_load(i8* %a, i32 0), !dbg
     12 
     13 define i8 @atomic8_load_monotonic(i8* %a) nounwind uwtable {
     14 entry:
     15   %0 = load atomic i8, i8* %a monotonic, align 1, !dbg !7
     16   ret i8 %0, !dbg !7
     17 }
     18 ; CHECK-LABEL: atomic8_load_monotonic
     19 ; CHECK: call i8 @__tsan_atomic8_load(i8* %a, i32 0), !dbg
     20 
     21 define i8 @atomic8_load_acquire(i8* %a) nounwind uwtable {
     22 entry:
     23   %0 = load atomic i8, i8* %a acquire, align 1, !dbg !7
     24   ret i8 %0, !dbg !7
     25 }
     26 ; CHECK-LABEL: atomic8_load_acquire
     27 ; CHECK: call i8 @__tsan_atomic8_load(i8* %a, i32 2), !dbg
     28 
     29 define i8 @atomic8_load_seq_cst(i8* %a) nounwind uwtable {
     30 entry:
     31   %0 = load atomic i8, i8* %a seq_cst, align 1, !dbg !7
     32   ret i8 %0, !dbg !7
     33 }
     34 ; CHECK-LABEL: atomic8_load_seq_cst
     35 ; CHECK: call i8 @__tsan_atomic8_load(i8* %a, i32 5), !dbg
     36 
     37 define void @atomic8_store_unordered(i8* %a) nounwind uwtable {
     38 entry:
     39   store atomic i8 0, i8* %a unordered, align 1, !dbg !7
     40   ret void, !dbg !7
     41 }
     42 ; CHECK-LABEL: atomic8_store_unordered
     43 ; CHECK: call void @__tsan_atomic8_store(i8* %a, i8 0, i32 0), !dbg
     44 
     45 define void @atomic8_store_monotonic(i8* %a) nounwind uwtable {
     46 entry:
     47   store atomic i8 0, i8* %a monotonic, align 1, !dbg !7
     48   ret void, !dbg !7
     49 }
     50 ; CHECK-LABEL: atomic8_store_monotonic
     51 ; CHECK: call void @__tsan_atomic8_store(i8* %a, i8 0, i32 0), !dbg
     52 
     53 define void @atomic8_store_release(i8* %a) nounwind uwtable {
     54 entry:
     55   store atomic i8 0, i8* %a release, align 1, !dbg !7
     56   ret void, !dbg !7
     57 }
     58 ; CHECK-LABEL: atomic8_store_release
     59 ; CHECK: call void @__tsan_atomic8_store(i8* %a, i8 0, i32 3), !dbg
     60 
     61 define void @atomic8_store_seq_cst(i8* %a) nounwind uwtable {
     62 entry:
     63   store atomic i8 0, i8* %a seq_cst, align 1, !dbg !7
     64   ret void, !dbg !7
     65 }
     66 ; CHECK-LABEL: atomic8_store_seq_cst
     67 ; CHECK: call void @__tsan_atomic8_store(i8* %a, i8 0, i32 5), !dbg
     68 
     69 define void @atomic8_xchg_monotonic(i8* %a) nounwind uwtable {
     70 entry:
     71   atomicrmw xchg i8* %a, i8 0 monotonic, !dbg !7
     72   ret void, !dbg !7
     73 }
     74 ; CHECK-LABEL: atomic8_xchg_monotonic
     75 ; CHECK: call i8 @__tsan_atomic8_exchange(i8* %a, i8 0, i32 0), !dbg
     76 
     77 define void @atomic8_add_monotonic(i8* %a) nounwind uwtable {
     78 entry:
     79   atomicrmw add i8* %a, i8 0 monotonic, !dbg !7
     80   ret void, !dbg !7
     81 }
     82 ; CHECK-LABEL: atomic8_add_monotonic
     83 ; CHECK: call i8 @__tsan_atomic8_fetch_add(i8* %a, i8 0, i32 0), !dbg
     84 
     85 define void @atomic8_sub_monotonic(i8* %a) nounwind uwtable {
     86 entry:
     87   atomicrmw sub i8* %a, i8 0 monotonic, !dbg !7
     88   ret void, !dbg !7
     89 }
     90 ; CHECK-LABEL: atomic8_sub_monotonic
     91 ; CHECK: call i8 @__tsan_atomic8_fetch_sub(i8* %a, i8 0, i32 0), !dbg
     92 
     93 define void @atomic8_and_monotonic(i8* %a) nounwind uwtable {
     94 entry:
     95   atomicrmw and i8* %a, i8 0 monotonic, !dbg !7
     96   ret void, !dbg !7
     97 }
     98 ; CHECK-LABEL: atomic8_and_monotonic
     99 ; CHECK: call i8 @__tsan_atomic8_fetch_and(i8* %a, i8 0, i32 0), !dbg
    100 
    101 define void @atomic8_or_monotonic(i8* %a) nounwind uwtable {
    102 entry:
    103   atomicrmw or i8* %a, i8 0 monotonic, !dbg !7
    104   ret void, !dbg !7
    105 }
    106 ; CHECK-LABEL: atomic8_or_monotonic
    107 ; CHECK: call i8 @__tsan_atomic8_fetch_or(i8* %a, i8 0, i32 0), !dbg
    108 
    109 define void @atomic8_xor_monotonic(i8* %a) nounwind uwtable {
    110 entry:
    111   atomicrmw xor i8* %a, i8 0 monotonic, !dbg !7
    112   ret void, !dbg !7
    113 }
    114 ; CHECK-LABEL: atomic8_xor_monotonic
    115 ; CHECK: call i8 @__tsan_atomic8_fetch_xor(i8* %a, i8 0, i32 0), !dbg
    116 
    117 define void @atomic8_nand_monotonic(i8* %a) nounwind uwtable {
    118 entry:
    119   atomicrmw nand i8* %a, i8 0 monotonic, !dbg !7
    120   ret void, !dbg !7
    121 }
    122 ; CHECK-LABEL: atomic8_nand_monotonic
    123 ; CHECK: call i8 @__tsan_atomic8_fetch_nand(i8* %a, i8 0, i32 0), !dbg
    124 
    125 define void @atomic8_xchg_acquire(i8* %a) nounwind uwtable {
    126 entry:
    127   atomicrmw xchg i8* %a, i8 0 acquire, !dbg !7
    128   ret void, !dbg !7
    129 }
    130 ; CHECK-LABEL: atomic8_xchg_acquire
    131 ; CHECK: call i8 @__tsan_atomic8_exchange(i8* %a, i8 0, i32 2), !dbg
    132 
    133 define void @atomic8_add_acquire(i8* %a) nounwind uwtable {
    134 entry:
    135   atomicrmw add i8* %a, i8 0 acquire, !dbg !7
    136   ret void, !dbg !7
    137 }
    138 ; CHECK-LABEL: atomic8_add_acquire
    139 ; CHECK: call i8 @__tsan_atomic8_fetch_add(i8* %a, i8 0, i32 2), !dbg
    140 
    141 define void @atomic8_sub_acquire(i8* %a) nounwind uwtable {
    142 entry:
    143   atomicrmw sub i8* %a, i8 0 acquire, !dbg !7
    144   ret void, !dbg !7
    145 }
    146 ; CHECK-LABEL: atomic8_sub_acquire
    147 ; CHECK: call i8 @__tsan_atomic8_fetch_sub(i8* %a, i8 0, i32 2), !dbg
    148 
    149 define void @atomic8_and_acquire(i8* %a) nounwind uwtable {
    150 entry:
    151   atomicrmw and i8* %a, i8 0 acquire, !dbg !7
    152   ret void, !dbg !7
    153 }
    154 ; CHECK-LABEL: atomic8_and_acquire
    155 ; CHECK: call i8 @__tsan_atomic8_fetch_and(i8* %a, i8 0, i32 2), !dbg
    156 
    157 define void @atomic8_or_acquire(i8* %a) nounwind uwtable {
    158 entry:
    159   atomicrmw or i8* %a, i8 0 acquire, !dbg !7
    160   ret void, !dbg !7
    161 }
    162 ; CHECK-LABEL: atomic8_or_acquire
    163 ; CHECK: call i8 @__tsan_atomic8_fetch_or(i8* %a, i8 0, i32 2), !dbg
    164 
    165 define void @atomic8_xor_acquire(i8* %a) nounwind uwtable {
    166 entry:
    167   atomicrmw xor i8* %a, i8 0 acquire, !dbg !7
    168   ret void, !dbg !7
    169 }
    170 ; CHECK-LABEL: atomic8_xor_acquire
    171 ; CHECK: call i8 @__tsan_atomic8_fetch_xor(i8* %a, i8 0, i32 2), !dbg
    172 
    173 define void @atomic8_nand_acquire(i8* %a) nounwind uwtable {
    174 entry:
    175   atomicrmw nand i8* %a, i8 0 acquire, !dbg !7
    176   ret void, !dbg !7
    177 }
    178 ; CHECK-LABEL: atomic8_nand_acquire
    179 ; CHECK: call i8 @__tsan_atomic8_fetch_nand(i8* %a, i8 0, i32 2), !dbg
    180 
    181 define void @atomic8_xchg_release(i8* %a) nounwind uwtable {
    182 entry:
    183   atomicrmw xchg i8* %a, i8 0 release, !dbg !7
    184   ret void, !dbg !7
    185 }
    186 ; CHECK-LABEL: atomic8_xchg_release
    187 ; CHECK: call i8 @__tsan_atomic8_exchange(i8* %a, i8 0, i32 3), !dbg
    188 
    189 define void @atomic8_add_release(i8* %a) nounwind uwtable {
    190 entry:
    191   atomicrmw add i8* %a, i8 0 release, !dbg !7
    192   ret void, !dbg !7
    193 }
    194 ; CHECK-LABEL: atomic8_add_release
    195 ; CHECK: call i8 @__tsan_atomic8_fetch_add(i8* %a, i8 0, i32 3), !dbg
    196 
    197 define void @atomic8_sub_release(i8* %a) nounwind uwtable {
    198 entry:
    199   atomicrmw sub i8* %a, i8 0 release, !dbg !7
    200   ret void, !dbg !7
    201 }
    202 ; CHECK-LABEL: atomic8_sub_release
    203 ; CHECK: call i8 @__tsan_atomic8_fetch_sub(i8* %a, i8 0, i32 3), !dbg
    204 
    205 define void @atomic8_and_release(i8* %a) nounwind uwtable {
    206 entry:
    207   atomicrmw and i8* %a, i8 0 release, !dbg !7
    208   ret void, !dbg !7
    209 }
    210 ; CHECK-LABEL: atomic8_and_release
    211 ; CHECK: call i8 @__tsan_atomic8_fetch_and(i8* %a, i8 0, i32 3), !dbg
    212 
    213 define void @atomic8_or_release(i8* %a) nounwind uwtable {
    214 entry:
    215   atomicrmw or i8* %a, i8 0 release, !dbg !7
    216   ret void, !dbg !7
    217 }
    218 ; CHECK-LABEL: atomic8_or_release
    219 ; CHECK: call i8 @__tsan_atomic8_fetch_or(i8* %a, i8 0, i32 3), !dbg
    220 
    221 define void @atomic8_xor_release(i8* %a) nounwind uwtable {
    222 entry:
    223   atomicrmw xor i8* %a, i8 0 release, !dbg !7
    224   ret void, !dbg !7
    225 }
    226 ; CHECK-LABEL: atomic8_xor_release
    227 ; CHECK: call i8 @__tsan_atomic8_fetch_xor(i8* %a, i8 0, i32 3), !dbg
    228 
    229 define void @atomic8_nand_release(i8* %a) nounwind uwtable {
    230 entry:
    231   atomicrmw nand i8* %a, i8 0 release, !dbg !7
    232   ret void, !dbg !7
    233 }
    234 ; CHECK-LABEL: atomic8_nand_release
    235 ; CHECK: call i8 @__tsan_atomic8_fetch_nand(i8* %a, i8 0, i32 3), !dbg
    236 
    237 define void @atomic8_xchg_acq_rel(i8* %a) nounwind uwtable {
    238 entry:
    239   atomicrmw xchg i8* %a, i8 0 acq_rel, !dbg !7
    240   ret void, !dbg !7
    241 }
    242 ; CHECK-LABEL: atomic8_xchg_acq_rel
    243 ; CHECK: call i8 @__tsan_atomic8_exchange(i8* %a, i8 0, i32 4), !dbg
    244 
    245 define void @atomic8_add_acq_rel(i8* %a) nounwind uwtable {
    246 entry:
    247   atomicrmw add i8* %a, i8 0 acq_rel, !dbg !7
    248   ret void, !dbg !7
    249 }
    250 ; CHECK-LABEL: atomic8_add_acq_rel
    251 ; CHECK: call i8 @__tsan_atomic8_fetch_add(i8* %a, i8 0, i32 4), !dbg
    252 
    253 define void @atomic8_sub_acq_rel(i8* %a) nounwind uwtable {
    254 entry:
    255   atomicrmw sub i8* %a, i8 0 acq_rel, !dbg !7
    256   ret void, !dbg !7
    257 }
    258 ; CHECK-LABEL: atomic8_sub_acq_rel
    259 ; CHECK: call i8 @__tsan_atomic8_fetch_sub(i8* %a, i8 0, i32 4), !dbg
    260 
    261 define void @atomic8_and_acq_rel(i8* %a) nounwind uwtable {
    262 entry:
    263   atomicrmw and i8* %a, i8 0 acq_rel, !dbg !7
    264   ret void, !dbg !7
    265 }
    266 ; CHECK-LABEL: atomic8_and_acq_rel
    267 ; CHECK: call i8 @__tsan_atomic8_fetch_and(i8* %a, i8 0, i32 4), !dbg
    268 
    269 define void @atomic8_or_acq_rel(i8* %a) nounwind uwtable {
    270 entry:
    271   atomicrmw or i8* %a, i8 0 acq_rel, !dbg !7
    272   ret void, !dbg !7
    273 }
    274 ; CHECK-LABEL: atomic8_or_acq_rel
    275 ; CHECK: call i8 @__tsan_atomic8_fetch_or(i8* %a, i8 0, i32 4), !dbg
    276 
    277 define void @atomic8_xor_acq_rel(i8* %a) nounwind uwtable {
    278 entry:
    279   atomicrmw xor i8* %a, i8 0 acq_rel, !dbg !7
    280   ret void, !dbg !7
    281 }
    282 ; CHECK-LABEL: atomic8_xor_acq_rel
    283 ; CHECK: call i8 @__tsan_atomic8_fetch_xor(i8* %a, i8 0, i32 4), !dbg
    284 
    285 define void @atomic8_nand_acq_rel(i8* %a) nounwind uwtable {
    286 entry:
    287   atomicrmw nand i8* %a, i8 0 acq_rel, !dbg !7
    288   ret void, !dbg !7
    289 }
    290 ; CHECK-LABEL: atomic8_nand_acq_rel
    291 ; CHECK: call i8 @__tsan_atomic8_fetch_nand(i8* %a, i8 0, i32 4), !dbg
    292 
    293 define void @atomic8_xchg_seq_cst(i8* %a) nounwind uwtable {
    294 entry:
    295   atomicrmw xchg i8* %a, i8 0 seq_cst, !dbg !7
    296   ret void, !dbg !7
    297 }
    298 ; CHECK-LABEL: atomic8_xchg_seq_cst
    299 ; CHECK: call i8 @__tsan_atomic8_exchange(i8* %a, i8 0, i32 5), !dbg
    300 
    301 define void @atomic8_add_seq_cst(i8* %a) nounwind uwtable {
    302 entry:
    303   atomicrmw add i8* %a, i8 0 seq_cst, !dbg !7
    304   ret void, !dbg !7
    305 }
    306 ; CHECK-LABEL: atomic8_add_seq_cst
    307 ; CHECK: call i8 @__tsan_atomic8_fetch_add(i8* %a, i8 0, i32 5), !dbg
    308 
    309 define void @atomic8_sub_seq_cst(i8* %a) nounwind uwtable {
    310 entry:
    311   atomicrmw sub i8* %a, i8 0 seq_cst, !dbg !7
    312   ret void, !dbg !7
    313 }
    314 ; CHECK-LABEL: atomic8_sub_seq_cst
    315 ; CHECK: call i8 @__tsan_atomic8_fetch_sub(i8* %a, i8 0, i32 5), !dbg
    316 
    317 define void @atomic8_and_seq_cst(i8* %a) nounwind uwtable {
    318 entry:
    319   atomicrmw and i8* %a, i8 0 seq_cst, !dbg !7
    320   ret void, !dbg !7
    321 }
    322 ; CHECK-LABEL: atomic8_and_seq_cst
    323 ; CHECK: call i8 @__tsan_atomic8_fetch_and(i8* %a, i8 0, i32 5), !dbg
    324 
    325 define void @atomic8_or_seq_cst(i8* %a) nounwind uwtable {
    326 entry:
    327   atomicrmw or i8* %a, i8 0 seq_cst, !dbg !7
    328   ret void, !dbg !7
    329 }
    330 ; CHECK-LABEL: atomic8_or_seq_cst
    331 ; CHECK: call i8 @__tsan_atomic8_fetch_or(i8* %a, i8 0, i32 5), !dbg
    332 
    333 define void @atomic8_xor_seq_cst(i8* %a) nounwind uwtable {
    334 entry:
    335   atomicrmw xor i8* %a, i8 0 seq_cst, !dbg !7
    336   ret void, !dbg !7
    337 }
    338 ; CHECK-LABEL: atomic8_xor_seq_cst
    339 ; CHECK: call i8 @__tsan_atomic8_fetch_xor(i8* %a, i8 0, i32 5), !dbg
    340 
    341 define void @atomic8_nand_seq_cst(i8* %a) nounwind uwtable {
    342 entry:
    343   atomicrmw nand i8* %a, i8 0 seq_cst, !dbg !7
    344   ret void, !dbg !7
    345 }
    346 ; CHECK-LABEL: atomic8_nand_seq_cst
    347 ; CHECK: call i8 @__tsan_atomic8_fetch_nand(i8* %a, i8 0, i32 5), !dbg
    348 
    349 define void @atomic8_cas_monotonic(i8* %a) nounwind uwtable {
    350 entry:
    351   cmpxchg i8* %a, i8 0, i8 1 monotonic monotonic, !dbg !7
    352   ret void, !dbg !7
    353 }
    354 ; CHECK-LABEL: atomic8_cas_monotonic
    355 ; CHECK: call i8 @__tsan_atomic8_compare_exchange_val(i8* %a, i8 0, i8 1, i32 0, i32 0), !dbg
    356 
    357 define void @atomic8_cas_acquire(i8* %a) nounwind uwtable {
    358 entry:
    359   cmpxchg i8* %a, i8 0, i8 1 acquire acquire, !dbg !7
    360   ret void, !dbg !7
    361 }
    362 ; CHECK-LABEL: atomic8_cas_acquire
    363 ; CHECK: call i8 @__tsan_atomic8_compare_exchange_val(i8* %a, i8 0, i8 1, i32 2, i32 2), !dbg
    364 
    365 define void @atomic8_cas_release(i8* %a) nounwind uwtable {
    366 entry:
    367   cmpxchg i8* %a, i8 0, i8 1 release monotonic, !dbg !7
    368   ret void, !dbg !7
    369 }
    370 ; CHECK-LABEL: atomic8_cas_release
    371 ; CHECK: call i8 @__tsan_atomic8_compare_exchange_val(i8* %a, i8 0, i8 1, i32 3, i32 0), !dbg
    372 
    373 define void @atomic8_cas_acq_rel(i8* %a) nounwind uwtable {
    374 entry:
    375   cmpxchg i8* %a, i8 0, i8 1 acq_rel acquire, !dbg !7
    376   ret void, !dbg !7
    377 }
    378 ; CHECK-LABEL: atomic8_cas_acq_rel
    379 ; CHECK: call i8 @__tsan_atomic8_compare_exchange_val(i8* %a, i8 0, i8 1, i32 4, i32 2), !dbg
    380 
    381 define void @atomic8_cas_seq_cst(i8* %a) nounwind uwtable {
    382 entry:
    383   cmpxchg i8* %a, i8 0, i8 1 seq_cst seq_cst, !dbg !7
    384   ret void, !dbg !7
    385 }
    386 ; CHECK-LABEL: atomic8_cas_seq_cst
    387 ; CHECK: call i8 @__tsan_atomic8_compare_exchange_val(i8* %a, i8 0, i8 1, i32 5, i32 5), !dbg
    388 
    389 define i16 @atomic16_load_unordered(i16* %a) nounwind uwtable {
    390 entry:
    391   %0 = load atomic i16, i16* %a unordered, align 2, !dbg !7
    392   ret i16 %0, !dbg !7
    393 }
    394 ; CHECK-LABEL: atomic16_load_unordered
    395 ; CHECK: call i16 @__tsan_atomic16_load(i16* %a, i32 0), !dbg
    396 
    397 define i16 @atomic16_load_monotonic(i16* %a) nounwind uwtable {
    398 entry:
    399   %0 = load atomic i16, i16* %a monotonic, align 2, !dbg !7
    400   ret i16 %0, !dbg !7
    401 }
    402 ; CHECK-LABEL: atomic16_load_monotonic
    403 ; CHECK: call i16 @__tsan_atomic16_load(i16* %a, i32 0), !dbg
    404 
    405 define i16 @atomic16_load_acquire(i16* %a) nounwind uwtable {
    406 entry:
    407   %0 = load atomic i16, i16* %a acquire, align 2, !dbg !7
    408   ret i16 %0, !dbg !7
    409 }
    410 ; CHECK-LABEL: atomic16_load_acquire
    411 ; CHECK: call i16 @__tsan_atomic16_load(i16* %a, i32 2), !dbg
    412 
    413 define i16 @atomic16_load_seq_cst(i16* %a) nounwind uwtable {
    414 entry:
    415   %0 = load atomic i16, i16* %a seq_cst, align 2, !dbg !7
    416   ret i16 %0, !dbg !7
    417 }
    418 ; CHECK-LABEL: atomic16_load_seq_cst
    419 ; CHECK: call i16 @__tsan_atomic16_load(i16* %a, i32 5), !dbg
    420 
    421 define void @atomic16_store_unordered(i16* %a) nounwind uwtable {
    422 entry:
    423   store atomic i16 0, i16* %a unordered, align 2, !dbg !7
    424   ret void, !dbg !7
    425 }
    426 ; CHECK-LABEL: atomic16_store_unordered
    427 ; CHECK: call void @__tsan_atomic16_store(i16* %a, i16 0, i32 0), !dbg
    428 
    429 define void @atomic16_store_monotonic(i16* %a) nounwind uwtable {
    430 entry:
    431   store atomic i16 0, i16* %a monotonic, align 2, !dbg !7
    432   ret void, !dbg !7
    433 }
    434 ; CHECK-LABEL: atomic16_store_monotonic
    435 ; CHECK: call void @__tsan_atomic16_store(i16* %a, i16 0, i32 0), !dbg
    436 
    437 define void @atomic16_store_release(i16* %a) nounwind uwtable {
    438 entry:
    439   store atomic i16 0, i16* %a release, align 2, !dbg !7
    440   ret void, !dbg !7
    441 }
    442 ; CHECK-LABEL: atomic16_store_release
    443 ; CHECK: call void @__tsan_atomic16_store(i16* %a, i16 0, i32 3), !dbg
    444 
    445 define void @atomic16_store_seq_cst(i16* %a) nounwind uwtable {
    446 entry:
    447   store atomic i16 0, i16* %a seq_cst, align 2, !dbg !7
    448   ret void, !dbg !7
    449 }
    450 ; CHECK-LABEL: atomic16_store_seq_cst
    451 ; CHECK: call void @__tsan_atomic16_store(i16* %a, i16 0, i32 5), !dbg
    452 
    453 define void @atomic16_xchg_monotonic(i16* %a) nounwind uwtable {
    454 entry:
    455   atomicrmw xchg i16* %a, i16 0 monotonic, !dbg !7
    456   ret void, !dbg !7
    457 }
    458 ; CHECK-LABEL: atomic16_xchg_monotonic
    459 ; CHECK: call i16 @__tsan_atomic16_exchange(i16* %a, i16 0, i32 0), !dbg
    460 
    461 define void @atomic16_add_monotonic(i16* %a) nounwind uwtable {
    462 entry:
    463   atomicrmw add i16* %a, i16 0 monotonic, !dbg !7
    464   ret void, !dbg !7
    465 }
    466 ; CHECK-LABEL: atomic16_add_monotonic
    467 ; CHECK: call i16 @__tsan_atomic16_fetch_add(i16* %a, i16 0, i32 0), !dbg
    468 
    469 define void @atomic16_sub_monotonic(i16* %a) nounwind uwtable {
    470 entry:
    471   atomicrmw sub i16* %a, i16 0 monotonic, !dbg !7
    472   ret void, !dbg !7
    473 }
    474 ; CHECK-LABEL: atomic16_sub_monotonic
    475 ; CHECK: call i16 @__tsan_atomic16_fetch_sub(i16* %a, i16 0, i32 0), !dbg
    476 
    477 define void @atomic16_and_monotonic(i16* %a) nounwind uwtable {
    478 entry:
    479   atomicrmw and i16* %a, i16 0 monotonic, !dbg !7
    480   ret void, !dbg !7
    481 }
    482 ; CHECK-LABEL: atomic16_and_monotonic
    483 ; CHECK: call i16 @__tsan_atomic16_fetch_and(i16* %a, i16 0, i32 0), !dbg
    484 
    485 define void @atomic16_or_monotonic(i16* %a) nounwind uwtable {
    486 entry:
    487   atomicrmw or i16* %a, i16 0 monotonic, !dbg !7
    488   ret void, !dbg !7
    489 }
    490 ; CHECK-LABEL: atomic16_or_monotonic
    491 ; CHECK: call i16 @__tsan_atomic16_fetch_or(i16* %a, i16 0, i32 0), !dbg
    492 
    493 define void @atomic16_xor_monotonic(i16* %a) nounwind uwtable {
    494 entry:
    495   atomicrmw xor i16* %a, i16 0 monotonic, !dbg !7
    496   ret void, !dbg !7
    497 }
    498 ; CHECK-LABEL: atomic16_xor_monotonic
    499 ; CHECK: call i16 @__tsan_atomic16_fetch_xor(i16* %a, i16 0, i32 0), !dbg
    500 
    501 define void @atomic16_nand_monotonic(i16* %a) nounwind uwtable {
    502 entry:
    503   atomicrmw nand i16* %a, i16 0 monotonic, !dbg !7
    504   ret void, !dbg !7
    505 }
    506 ; CHECK-LABEL: atomic16_nand_monotonic
    507 ; CHECK: call i16 @__tsan_atomic16_fetch_nand(i16* %a, i16 0, i32 0), !dbg
    508 
    509 define void @atomic16_xchg_acquire(i16* %a) nounwind uwtable {
    510 entry:
    511   atomicrmw xchg i16* %a, i16 0 acquire, !dbg !7
    512   ret void, !dbg !7
    513 }
    514 ; CHECK-LABEL: atomic16_xchg_acquire
    515 ; CHECK: call i16 @__tsan_atomic16_exchange(i16* %a, i16 0, i32 2), !dbg
    516 
    517 define void @atomic16_add_acquire(i16* %a) nounwind uwtable {
    518 entry:
    519   atomicrmw add i16* %a, i16 0 acquire, !dbg !7
    520   ret void, !dbg !7
    521 }
    522 ; CHECK-LABEL: atomic16_add_acquire
    523 ; CHECK: call i16 @__tsan_atomic16_fetch_add(i16* %a, i16 0, i32 2), !dbg
    524 
    525 define void @atomic16_sub_acquire(i16* %a) nounwind uwtable {
    526 entry:
    527   atomicrmw sub i16* %a, i16 0 acquire, !dbg !7
    528   ret void, !dbg !7
    529 }
    530 ; CHECK-LABEL: atomic16_sub_acquire
    531 ; CHECK: call i16 @__tsan_atomic16_fetch_sub(i16* %a, i16 0, i32 2), !dbg
    532 
    533 define void @atomic16_and_acquire(i16* %a) nounwind uwtable {
    534 entry:
    535   atomicrmw and i16* %a, i16 0 acquire, !dbg !7
    536   ret void, !dbg !7
    537 }
    538 ; CHECK-LABEL: atomic16_and_acquire
    539 ; CHECK: call i16 @__tsan_atomic16_fetch_and(i16* %a, i16 0, i32 2), !dbg
    540 
    541 define void @atomic16_or_acquire(i16* %a) nounwind uwtable {
    542 entry:
    543   atomicrmw or i16* %a, i16 0 acquire, !dbg !7
    544   ret void, !dbg !7
    545 }
    546 ; CHECK-LABEL: atomic16_or_acquire
    547 ; CHECK: call i16 @__tsan_atomic16_fetch_or(i16* %a, i16 0, i32 2), !dbg
    548 
    549 define void @atomic16_xor_acquire(i16* %a) nounwind uwtable {
    550 entry:
    551   atomicrmw xor i16* %a, i16 0 acquire, !dbg !7
    552   ret void, !dbg !7
    553 }
    554 ; CHECK-LABEL: atomic16_xor_acquire
    555 ; CHECK: call i16 @__tsan_atomic16_fetch_xor(i16* %a, i16 0, i32 2), !dbg
    556 
    557 define void @atomic16_nand_acquire(i16* %a) nounwind uwtable {
    558 entry:
    559   atomicrmw nand i16* %a, i16 0 acquire, !dbg !7
    560   ret void, !dbg !7
    561 }
    562 ; CHECK-LABEL: atomic16_nand_acquire
    563 ; CHECK: call i16 @__tsan_atomic16_fetch_nand(i16* %a, i16 0, i32 2), !dbg
    564 
    565 define void @atomic16_xchg_release(i16* %a) nounwind uwtable {
    566 entry:
    567   atomicrmw xchg i16* %a, i16 0 release, !dbg !7
    568   ret void, !dbg !7
    569 }
    570 ; CHECK-LABEL: atomic16_xchg_release
    571 ; CHECK: call i16 @__tsan_atomic16_exchange(i16* %a, i16 0, i32 3), !dbg
    572 
    573 define void @atomic16_add_release(i16* %a) nounwind uwtable {
    574 entry:
    575   atomicrmw add i16* %a, i16 0 release, !dbg !7
    576   ret void, !dbg !7
    577 }
    578 ; CHECK-LABEL: atomic16_add_release
    579 ; CHECK: call i16 @__tsan_atomic16_fetch_add(i16* %a, i16 0, i32 3), !dbg
    580 
    581 define void @atomic16_sub_release(i16* %a) nounwind uwtable {
    582 entry:
    583   atomicrmw sub i16* %a, i16 0 release, !dbg !7
    584   ret void, !dbg !7
    585 }
    586 ; CHECK-LABEL: atomic16_sub_release
    587 ; CHECK: call i16 @__tsan_atomic16_fetch_sub(i16* %a, i16 0, i32 3), !dbg
    588 
    589 define void @atomic16_and_release(i16* %a) nounwind uwtable {
    590 entry:
    591   atomicrmw and i16* %a, i16 0 release, !dbg !7
    592   ret void, !dbg !7
    593 }
    594 ; CHECK-LABEL: atomic16_and_release
    595 ; CHECK: call i16 @__tsan_atomic16_fetch_and(i16* %a, i16 0, i32 3), !dbg
    596 
    597 define void @atomic16_or_release(i16* %a) nounwind uwtable {
    598 entry:
    599   atomicrmw or i16* %a, i16 0 release, !dbg !7
    600   ret void, !dbg !7
    601 }
    602 ; CHECK-LABEL: atomic16_or_release
    603 ; CHECK: call i16 @__tsan_atomic16_fetch_or(i16* %a, i16 0, i32 3), !dbg
    604 
    605 define void @atomic16_xor_release(i16* %a) nounwind uwtable {
    606 entry:
    607   atomicrmw xor i16* %a, i16 0 release, !dbg !7
    608   ret void, !dbg !7
    609 }
    610 ; CHECK-LABEL: atomic16_xor_release
    611 ; CHECK: call i16 @__tsan_atomic16_fetch_xor(i16* %a, i16 0, i32 3), !dbg
    612 
    613 define void @atomic16_nand_release(i16* %a) nounwind uwtable {
    614 entry:
    615   atomicrmw nand i16* %a, i16 0 release, !dbg !7
    616   ret void, !dbg !7
    617 }
    618 ; CHECK-LABEL: atomic16_nand_release
    619 ; CHECK: call i16 @__tsan_atomic16_fetch_nand(i16* %a, i16 0, i32 3), !dbg
    620 
    621 define void @atomic16_xchg_acq_rel(i16* %a) nounwind uwtable {
    622 entry:
    623   atomicrmw xchg i16* %a, i16 0 acq_rel, !dbg !7
    624   ret void, !dbg !7
    625 }
    626 ; CHECK-LABEL: atomic16_xchg_acq_rel
    627 ; CHECK: call i16 @__tsan_atomic16_exchange(i16* %a, i16 0, i32 4), !dbg
    628 
    629 define void @atomic16_add_acq_rel(i16* %a) nounwind uwtable {
    630 entry:
    631   atomicrmw add i16* %a, i16 0 acq_rel, !dbg !7
    632   ret void, !dbg !7
    633 }
    634 ; CHECK-LABEL: atomic16_add_acq_rel
    635 ; CHECK: call i16 @__tsan_atomic16_fetch_add(i16* %a, i16 0, i32 4), !dbg
    636 
    637 define void @atomic16_sub_acq_rel(i16* %a) nounwind uwtable {
    638 entry:
    639   atomicrmw sub i16* %a, i16 0 acq_rel, !dbg !7
    640   ret void, !dbg !7
    641 }
    642 ; CHECK-LABEL: atomic16_sub_acq_rel
    643 ; CHECK: call i16 @__tsan_atomic16_fetch_sub(i16* %a, i16 0, i32 4), !dbg
    644 
    645 define void @atomic16_and_acq_rel(i16* %a) nounwind uwtable {
    646 entry:
    647   atomicrmw and i16* %a, i16 0 acq_rel, !dbg !7
    648   ret void, !dbg !7
    649 }
    650 ; CHECK-LABEL: atomic16_and_acq_rel
    651 ; CHECK: call i16 @__tsan_atomic16_fetch_and(i16* %a, i16 0, i32 4), !dbg
    652 
    653 define void @atomic16_or_acq_rel(i16* %a) nounwind uwtable {
    654 entry:
    655   atomicrmw or i16* %a, i16 0 acq_rel, !dbg !7
    656   ret void, !dbg !7
    657 }
    658 ; CHECK-LABEL: atomic16_or_acq_rel
    659 ; CHECK: call i16 @__tsan_atomic16_fetch_or(i16* %a, i16 0, i32 4), !dbg
    660 
    661 define void @atomic16_xor_acq_rel(i16* %a) nounwind uwtable {
    662 entry:
    663   atomicrmw xor i16* %a, i16 0 acq_rel, !dbg !7
    664   ret void, !dbg !7
    665 }
    666 ; CHECK-LABEL: atomic16_xor_acq_rel
    667 ; CHECK: call i16 @__tsan_atomic16_fetch_xor(i16* %a, i16 0, i32 4), !dbg
    668 
    669 define void @atomic16_nand_acq_rel(i16* %a) nounwind uwtable {
    670 entry:
    671   atomicrmw nand i16* %a, i16 0 acq_rel, !dbg !7
    672   ret void, !dbg !7
    673 }
    674 ; CHECK-LABEL: atomic16_nand_acq_rel
    675 ; CHECK: call i16 @__tsan_atomic16_fetch_nand(i16* %a, i16 0, i32 4), !dbg
    676 
    677 define void @atomic16_xchg_seq_cst(i16* %a) nounwind uwtable {
    678 entry:
    679   atomicrmw xchg i16* %a, i16 0 seq_cst, !dbg !7
    680   ret void, !dbg !7
    681 }
    682 ; CHECK-LABEL: atomic16_xchg_seq_cst
    683 ; CHECK: call i16 @__tsan_atomic16_exchange(i16* %a, i16 0, i32 5), !dbg
    684 
    685 define void @atomic16_add_seq_cst(i16* %a) nounwind uwtable {
    686 entry:
    687   atomicrmw add i16* %a, i16 0 seq_cst, !dbg !7
    688   ret void, !dbg !7
    689 }
    690 ; CHECK-LABEL: atomic16_add_seq_cst
    691 ; CHECK: call i16 @__tsan_atomic16_fetch_add(i16* %a, i16 0, i32 5), !dbg
    692 
    693 define void @atomic16_sub_seq_cst(i16* %a) nounwind uwtable {
    694 entry:
    695   atomicrmw sub i16* %a, i16 0 seq_cst, !dbg !7
    696   ret void, !dbg !7
    697 }
    698 ; CHECK-LABEL: atomic16_sub_seq_cst
    699 ; CHECK: call i16 @__tsan_atomic16_fetch_sub(i16* %a, i16 0, i32 5), !dbg
    700 
    701 define void @atomic16_and_seq_cst(i16* %a) nounwind uwtable {
    702 entry:
    703   atomicrmw and i16* %a, i16 0 seq_cst, !dbg !7
    704   ret void, !dbg !7
    705 }
    706 ; CHECK-LABEL: atomic16_and_seq_cst
    707 ; CHECK: call i16 @__tsan_atomic16_fetch_and(i16* %a, i16 0, i32 5), !dbg
    708 
    709 define void @atomic16_or_seq_cst(i16* %a) nounwind uwtable {
    710 entry:
    711   atomicrmw or i16* %a, i16 0 seq_cst, !dbg !7
    712   ret void, !dbg !7
    713 }
    714 ; CHECK-LABEL: atomic16_or_seq_cst
    715 ; CHECK: call i16 @__tsan_atomic16_fetch_or(i16* %a, i16 0, i32 5), !dbg
    716 
    717 define void @atomic16_xor_seq_cst(i16* %a) nounwind uwtable {
    718 entry:
    719   atomicrmw xor i16* %a, i16 0 seq_cst, !dbg !7
    720   ret void, !dbg !7
    721 }
    722 ; CHECK-LABEL: atomic16_xor_seq_cst
    723 ; CHECK: call i16 @__tsan_atomic16_fetch_xor(i16* %a, i16 0, i32 5), !dbg
    724 
    725 define void @atomic16_nand_seq_cst(i16* %a) nounwind uwtable {
    726 entry:
    727   atomicrmw nand i16* %a, i16 0 seq_cst, !dbg !7
    728   ret void, !dbg !7
    729 }
    730 ; CHECK-LABEL: atomic16_nand_seq_cst
    731 ; CHECK: call i16 @__tsan_atomic16_fetch_nand(i16* %a, i16 0, i32 5), !dbg
    732 
    733 define void @atomic16_cas_monotonic(i16* %a) nounwind uwtable {
    734 entry:
    735   cmpxchg i16* %a, i16 0, i16 1 monotonic monotonic, !dbg !7
    736   ret void, !dbg !7
    737 }
    738 ; CHECK-LABEL: atomic16_cas_monotonic
    739 ; CHECK: call i16 @__tsan_atomic16_compare_exchange_val(i16* %a, i16 0, i16 1, i32 0, i32 0), !dbg
    740 
    741 define void @atomic16_cas_acquire(i16* %a) nounwind uwtable {
    742 entry:
    743   cmpxchg i16* %a, i16 0, i16 1 acquire acquire, !dbg !7
    744   ret void, !dbg !7
    745 }
    746 ; CHECK-LABEL: atomic16_cas_acquire
    747 ; CHECK: call i16 @__tsan_atomic16_compare_exchange_val(i16* %a, i16 0, i16 1, i32 2, i32 2), !dbg
    748 
    749 define void @atomic16_cas_release(i16* %a) nounwind uwtable {
    750 entry:
    751   cmpxchg i16* %a, i16 0, i16 1 release monotonic, !dbg !7
    752   ret void, !dbg !7
    753 }
    754 ; CHECK-LABEL: atomic16_cas_release
    755 ; CHECK: call i16 @__tsan_atomic16_compare_exchange_val(i16* %a, i16 0, i16 1, i32 3, i32 0), !dbg
    756 
    757 define void @atomic16_cas_acq_rel(i16* %a) nounwind uwtable {
    758 entry:
    759   cmpxchg i16* %a, i16 0, i16 1 acq_rel acquire, !dbg !7
    760   ret void, !dbg !7
    761 }
    762 ; CHECK-LABEL: atomic16_cas_acq_rel
    763 ; CHECK: call i16 @__tsan_atomic16_compare_exchange_val(i16* %a, i16 0, i16 1, i32 4, i32 2), !dbg
    764 
    765 define void @atomic16_cas_seq_cst(i16* %a) nounwind uwtable {
    766 entry:
    767   cmpxchg i16* %a, i16 0, i16 1 seq_cst seq_cst, !dbg !7
    768   ret void, !dbg !7
    769 }
    770 ; CHECK-LABEL: atomic16_cas_seq_cst
    771 ; CHECK: call i16 @__tsan_atomic16_compare_exchange_val(i16* %a, i16 0, i16 1, i32 5, i32 5), !dbg
    772 
    773 define i32 @atomic32_load_unordered(i32* %a) nounwind uwtable {
    774 entry:
    775   %0 = load atomic i32, i32* %a unordered, align 4, !dbg !7
    776   ret i32 %0, !dbg !7
    777 }
    778 ; CHECK-LABEL: atomic32_load_unordered
    779 ; CHECK: call i32 @__tsan_atomic32_load(i32* %a, i32 0), !dbg
    780 
    781 define i32 @atomic32_load_monotonic(i32* %a) nounwind uwtable {
    782 entry:
    783   %0 = load atomic i32, i32* %a monotonic, align 4, !dbg !7
    784   ret i32 %0, !dbg !7
    785 }
    786 ; CHECK-LABEL: atomic32_load_monotonic
    787 ; CHECK: call i32 @__tsan_atomic32_load(i32* %a, i32 0), !dbg
    788 
    789 define i32 @atomic32_load_acquire(i32* %a) nounwind uwtable {
    790 entry:
    791   %0 = load atomic i32, i32* %a acquire, align 4, !dbg !7
    792   ret i32 %0, !dbg !7
    793 }
    794 ; CHECK-LABEL: atomic32_load_acquire
    795 ; CHECK: call i32 @__tsan_atomic32_load(i32* %a, i32 2), !dbg
    796 
    797 define i32 @atomic32_load_seq_cst(i32* %a) nounwind uwtable {
    798 entry:
    799   %0 = load atomic i32, i32* %a seq_cst, align 4, !dbg !7
    800   ret i32 %0, !dbg !7
    801 }
    802 ; CHECK-LABEL: atomic32_load_seq_cst
    803 ; CHECK: call i32 @__tsan_atomic32_load(i32* %a, i32 5), !dbg
    804 
    805 define void @atomic32_store_unordered(i32* %a) nounwind uwtable {
    806 entry:
    807   store atomic i32 0, i32* %a unordered, align 4, !dbg !7
    808   ret void, !dbg !7
    809 }
    810 ; CHECK-LABEL: atomic32_store_unordered
    811 ; CHECK: call void @__tsan_atomic32_store(i32* %a, i32 0, i32 0), !dbg
    812 
    813 define void @atomic32_store_monotonic(i32* %a) nounwind uwtable {
    814 entry:
    815   store atomic i32 0, i32* %a monotonic, align 4, !dbg !7
    816   ret void, !dbg !7
    817 }
    818 ; CHECK-LABEL: atomic32_store_monotonic
    819 ; CHECK: call void @__tsan_atomic32_store(i32* %a, i32 0, i32 0), !dbg
    820 
    821 define void @atomic32_store_release(i32* %a) nounwind uwtable {
    822 entry:
    823   store atomic i32 0, i32* %a release, align 4, !dbg !7
    824   ret void, !dbg !7
    825 }
    826 ; CHECK-LABEL: atomic32_store_release
    827 ; CHECK: call void @__tsan_atomic32_store(i32* %a, i32 0, i32 3), !dbg
    828 
    829 define void @atomic32_store_seq_cst(i32* %a) nounwind uwtable {
    830 entry:
    831   store atomic i32 0, i32* %a seq_cst, align 4, !dbg !7
    832   ret void, !dbg !7
    833 }
    834 ; CHECK-LABEL: atomic32_store_seq_cst
    835 ; CHECK: call void @__tsan_atomic32_store(i32* %a, i32 0, i32 5), !dbg
    836 
    837 define void @atomic32_xchg_monotonic(i32* %a) nounwind uwtable {
    838 entry:
    839   atomicrmw xchg i32* %a, i32 0 monotonic, !dbg !7
    840   ret void, !dbg !7
    841 }
    842 ; CHECK-LABEL: atomic32_xchg_monotonic
    843 ; CHECK: call i32 @__tsan_atomic32_exchange(i32* %a, i32 0, i32 0), !dbg
    844 
    845 define void @atomic32_add_monotonic(i32* %a) nounwind uwtable {
    846 entry:
    847   atomicrmw add i32* %a, i32 0 monotonic, !dbg !7
    848   ret void, !dbg !7
    849 }
    850 ; CHECK-LABEL: atomic32_add_monotonic
    851 ; CHECK: call i32 @__tsan_atomic32_fetch_add(i32* %a, i32 0, i32 0), !dbg
    852 
    853 define void @atomic32_sub_monotonic(i32* %a) nounwind uwtable {
    854 entry:
    855   atomicrmw sub i32* %a, i32 0 monotonic, !dbg !7
    856   ret void, !dbg !7
    857 }
    858 ; CHECK-LABEL: atomic32_sub_monotonic
    859 ; CHECK: call i32 @__tsan_atomic32_fetch_sub(i32* %a, i32 0, i32 0), !dbg
    860 
    861 define void @atomic32_and_monotonic(i32* %a) nounwind uwtable {
    862 entry:
    863   atomicrmw and i32* %a, i32 0 monotonic, !dbg !7
    864   ret void, !dbg !7
    865 }
    866 ; CHECK-LABEL: atomic32_and_monotonic
    867 ; CHECK: call i32 @__tsan_atomic32_fetch_and(i32* %a, i32 0, i32 0), !dbg
    868 
    869 define void @atomic32_or_monotonic(i32* %a) nounwind uwtable {
    870 entry:
    871   atomicrmw or i32* %a, i32 0 monotonic, !dbg !7
    872   ret void, !dbg !7
    873 }
    874 ; CHECK-LABEL: atomic32_or_monotonic
    875 ; CHECK: call i32 @__tsan_atomic32_fetch_or(i32* %a, i32 0, i32 0), !dbg
    876 
    877 define void @atomic32_xor_monotonic(i32* %a) nounwind uwtable {
    878 entry:
    879   atomicrmw xor i32* %a, i32 0 monotonic, !dbg !7
    880   ret void, !dbg !7
    881 }
    882 ; CHECK-LABEL: atomic32_xor_monotonic
    883 ; CHECK: call i32 @__tsan_atomic32_fetch_xor(i32* %a, i32 0, i32 0), !dbg
    884 
    885 define void @atomic32_nand_monotonic(i32* %a) nounwind uwtable {
    886 entry:
    887   atomicrmw nand i32* %a, i32 0 monotonic, !dbg !7
    888   ret void, !dbg !7
    889 }
    890 ; CHECK-LABEL: atomic32_nand_monotonic
    891 ; CHECK: call i32 @__tsan_atomic32_fetch_nand(i32* %a, i32 0, i32 0), !dbg
    892 
    893 define void @atomic32_xchg_acquire(i32* %a) nounwind uwtable {
    894 entry:
    895   atomicrmw xchg i32* %a, i32 0 acquire, !dbg !7
    896   ret void, !dbg !7
    897 }
    898 ; CHECK-LABEL: atomic32_xchg_acquire
    899 ; CHECK: call i32 @__tsan_atomic32_exchange(i32* %a, i32 0, i32 2), !dbg
    900 
    901 define void @atomic32_add_acquire(i32* %a) nounwind uwtable {
    902 entry:
    903   atomicrmw add i32* %a, i32 0 acquire, !dbg !7
    904   ret void, !dbg !7
    905 }
    906 ; CHECK-LABEL: atomic32_add_acquire
    907 ; CHECK: call i32 @__tsan_atomic32_fetch_add(i32* %a, i32 0, i32 2), !dbg
    908 
    909 define void @atomic32_sub_acquire(i32* %a) nounwind uwtable {
    910 entry:
    911   atomicrmw sub i32* %a, i32 0 acquire, !dbg !7
    912   ret void, !dbg !7
    913 }
    914 ; CHECK-LABEL: atomic32_sub_acquire
    915 ; CHECK: call i32 @__tsan_atomic32_fetch_sub(i32* %a, i32 0, i32 2), !dbg
    916 
    917 define void @atomic32_and_acquire(i32* %a) nounwind uwtable {
    918 entry:
    919   atomicrmw and i32* %a, i32 0 acquire, !dbg !7
    920   ret void, !dbg !7
    921 }
    922 ; CHECK-LABEL: atomic32_and_acquire
    923 ; CHECK: call i32 @__tsan_atomic32_fetch_and(i32* %a, i32 0, i32 2), !dbg
    924 
    925 define void @atomic32_or_acquire(i32* %a) nounwind uwtable {
    926 entry:
    927   atomicrmw or i32* %a, i32 0 acquire, !dbg !7
    928   ret void, !dbg !7
    929 }
    930 ; CHECK-LABEL: atomic32_or_acquire
    931 ; CHECK: call i32 @__tsan_atomic32_fetch_or(i32* %a, i32 0, i32 2), !dbg
    932 
    933 define void @atomic32_xor_acquire(i32* %a) nounwind uwtable {
    934 entry:
    935   atomicrmw xor i32* %a, i32 0 acquire, !dbg !7
    936   ret void, !dbg !7
    937 }
    938 ; CHECK-LABEL: atomic32_xor_acquire
    939 ; CHECK: call i32 @__tsan_atomic32_fetch_xor(i32* %a, i32 0, i32 2), !dbg
    940 
    941 define void @atomic32_nand_acquire(i32* %a) nounwind uwtable {
    942 entry:
    943   atomicrmw nand i32* %a, i32 0 acquire, !dbg !7
    944   ret void, !dbg !7
    945 }
    946 ; CHECK-LABEL: atomic32_nand_acquire
    947 ; CHECK: call i32 @__tsan_atomic32_fetch_nand(i32* %a, i32 0, i32 2), !dbg
    948 
    949 define void @atomic32_xchg_release(i32* %a) nounwind uwtable {
    950 entry:
    951   atomicrmw xchg i32* %a, i32 0 release, !dbg !7
    952   ret void, !dbg !7
    953 }
    954 ; CHECK-LABEL: atomic32_xchg_release
    955 ; CHECK: call i32 @__tsan_atomic32_exchange(i32* %a, i32 0, i32 3), !dbg
    956 
    957 define void @atomic32_add_release(i32* %a) nounwind uwtable {
    958 entry:
    959   atomicrmw add i32* %a, i32 0 release, !dbg !7
    960   ret void, !dbg !7
    961 }
    962 ; CHECK-LABEL: atomic32_add_release
    963 ; CHECK: call i32 @__tsan_atomic32_fetch_add(i32* %a, i32 0, i32 3), !dbg
    964 
    965 define void @atomic32_sub_release(i32* %a) nounwind uwtable {
    966 entry:
    967   atomicrmw sub i32* %a, i32 0 release, !dbg !7
    968   ret void, !dbg !7
    969 }
    970 ; CHECK-LABEL: atomic32_sub_release
    971 ; CHECK: call i32 @__tsan_atomic32_fetch_sub(i32* %a, i32 0, i32 3), !dbg
    972 
    973 define void @atomic32_and_release(i32* %a) nounwind uwtable {
    974 entry:
    975   atomicrmw and i32* %a, i32 0 release, !dbg !7
    976   ret void, !dbg !7
    977 }
    978 ; CHECK-LABEL: atomic32_and_release
    979 ; CHECK: call i32 @__tsan_atomic32_fetch_and(i32* %a, i32 0, i32 3), !dbg
    980 
    981 define void @atomic32_or_release(i32* %a) nounwind uwtable {
    982 entry:
    983   atomicrmw or i32* %a, i32 0 release, !dbg !7
    984   ret void, !dbg !7
    985 }
    986 ; CHECK-LABEL: atomic32_or_release
    987 ; CHECK: call i32 @__tsan_atomic32_fetch_or(i32* %a, i32 0, i32 3), !dbg
    988 
    989 define void @atomic32_xor_release(i32* %a) nounwind uwtable {
    990 entry:
    991   atomicrmw xor i32* %a, i32 0 release, !dbg !7
    992   ret void, !dbg !7
    993 }
    994 ; CHECK-LABEL: atomic32_xor_release
    995 ; CHECK: call i32 @__tsan_atomic32_fetch_xor(i32* %a, i32 0, i32 3), !dbg
    996 
    997 define void @atomic32_nand_release(i32* %a) nounwind uwtable {
    998 entry:
    999   atomicrmw nand i32* %a, i32 0 release, !dbg !7
   1000   ret void, !dbg !7
   1001 }
   1002 ; CHECK-LABEL: atomic32_nand_release
   1003 ; CHECK: call i32 @__tsan_atomic32_fetch_nand(i32* %a, i32 0, i32 3), !dbg
   1004 
   1005 define void @atomic32_xchg_acq_rel(i32* %a) nounwind uwtable {
   1006 entry:
   1007   atomicrmw xchg i32* %a, i32 0 acq_rel, !dbg !7
   1008   ret void, !dbg !7
   1009 }
   1010 ; CHECK-LABEL: atomic32_xchg_acq_rel
   1011 ; CHECK: call i32 @__tsan_atomic32_exchange(i32* %a, i32 0, i32 4), !dbg
   1012 
   1013 define void @atomic32_add_acq_rel(i32* %a) nounwind uwtable {
   1014 entry:
   1015   atomicrmw add i32* %a, i32 0 acq_rel, !dbg !7
   1016   ret void, !dbg !7
   1017 }
   1018 ; CHECK-LABEL: atomic32_add_acq_rel
   1019 ; CHECK: call i32 @__tsan_atomic32_fetch_add(i32* %a, i32 0, i32 4), !dbg
   1020 
   1021 define void @atomic32_sub_acq_rel(i32* %a) nounwind uwtable {
   1022 entry:
   1023   atomicrmw sub i32* %a, i32 0 acq_rel, !dbg !7
   1024   ret void, !dbg !7
   1025 }
   1026 ; CHECK-LABEL: atomic32_sub_acq_rel
   1027 ; CHECK: call i32 @__tsan_atomic32_fetch_sub(i32* %a, i32 0, i32 4), !dbg
   1028 
   1029 define void @atomic32_and_acq_rel(i32* %a) nounwind uwtable {
   1030 entry:
   1031   atomicrmw and i32* %a, i32 0 acq_rel, !dbg !7
   1032   ret void, !dbg !7
   1033 }
   1034 ; CHECK-LABEL: atomic32_and_acq_rel
   1035 ; CHECK: call i32 @__tsan_atomic32_fetch_and(i32* %a, i32 0, i32 4), !dbg
   1036 
   1037 define void @atomic32_or_acq_rel(i32* %a) nounwind uwtable {
   1038 entry:
   1039   atomicrmw or i32* %a, i32 0 acq_rel, !dbg !7
   1040   ret void, !dbg !7
   1041 }
   1042 ; CHECK-LABEL: atomic32_or_acq_rel
   1043 ; CHECK: call i32 @__tsan_atomic32_fetch_or(i32* %a, i32 0, i32 4), !dbg
   1044 
   1045 define void @atomic32_xor_acq_rel(i32* %a) nounwind uwtable {
   1046 entry:
   1047   atomicrmw xor i32* %a, i32 0 acq_rel, !dbg !7
   1048   ret void, !dbg !7
   1049 }
   1050 ; CHECK-LABEL: atomic32_xor_acq_rel
   1051 ; CHECK: call i32 @__tsan_atomic32_fetch_xor(i32* %a, i32 0, i32 4), !dbg
   1052 
   1053 define void @atomic32_nand_acq_rel(i32* %a) nounwind uwtable {
   1054 entry:
   1055   atomicrmw nand i32* %a, i32 0 acq_rel, !dbg !7
   1056   ret void, !dbg !7
   1057 }
   1058 ; CHECK-LABEL: atomic32_nand_acq_rel
   1059 ; CHECK: call i32 @__tsan_atomic32_fetch_nand(i32* %a, i32 0, i32 4), !dbg
   1060 
   1061 define void @atomic32_xchg_seq_cst(i32* %a) nounwind uwtable {
   1062 entry:
   1063   atomicrmw xchg i32* %a, i32 0 seq_cst, !dbg !7
   1064   ret void, !dbg !7
   1065 }
   1066 ; CHECK-LABEL: atomic32_xchg_seq_cst
   1067 ; CHECK: call i32 @__tsan_atomic32_exchange(i32* %a, i32 0, i32 5), !dbg
   1068 
   1069 define void @atomic32_add_seq_cst(i32* %a) nounwind uwtable {
   1070 entry:
   1071   atomicrmw add i32* %a, i32 0 seq_cst, !dbg !7
   1072   ret void, !dbg !7
   1073 }
   1074 ; CHECK-LABEL: atomic32_add_seq_cst
   1075 ; CHECK: call i32 @__tsan_atomic32_fetch_add(i32* %a, i32 0, i32 5), !dbg
   1076 
   1077 define void @atomic32_sub_seq_cst(i32* %a) nounwind uwtable {
   1078 entry:
   1079   atomicrmw sub i32* %a, i32 0 seq_cst, !dbg !7
   1080   ret void, !dbg !7
   1081 }
   1082 ; CHECK-LABEL: atomic32_sub_seq_cst
   1083 ; CHECK: call i32 @__tsan_atomic32_fetch_sub(i32* %a, i32 0, i32 5), !dbg
   1084 
   1085 define void @atomic32_and_seq_cst(i32* %a) nounwind uwtable {
   1086 entry:
   1087   atomicrmw and i32* %a, i32 0 seq_cst, !dbg !7
   1088   ret void, !dbg !7
   1089 }
   1090 ; CHECK-LABEL: atomic32_and_seq_cst
   1091 ; CHECK: call i32 @__tsan_atomic32_fetch_and(i32* %a, i32 0, i32 5), !dbg
   1092 
   1093 define void @atomic32_or_seq_cst(i32* %a) nounwind uwtable {
   1094 entry:
   1095   atomicrmw or i32* %a, i32 0 seq_cst, !dbg !7
   1096   ret void, !dbg !7
   1097 }
   1098 ; CHECK-LABEL: atomic32_or_seq_cst
   1099 ; CHECK: call i32 @__tsan_atomic32_fetch_or(i32* %a, i32 0, i32 5), !dbg
   1100 
   1101 define void @atomic32_xor_seq_cst(i32* %a) nounwind uwtable {
   1102 entry:
   1103   atomicrmw xor i32* %a, i32 0 seq_cst, !dbg !7
   1104   ret void, !dbg !7
   1105 }
   1106 ; CHECK-LABEL: atomic32_xor_seq_cst
   1107 ; CHECK: call i32 @__tsan_atomic32_fetch_xor(i32* %a, i32 0, i32 5), !dbg
   1108 
   1109 define void @atomic32_nand_seq_cst(i32* %a) nounwind uwtable {
   1110 entry:
   1111   atomicrmw nand i32* %a, i32 0 seq_cst, !dbg !7
   1112   ret void, !dbg !7
   1113 }
   1114 ; CHECK-LABEL: atomic32_nand_seq_cst
   1115 ; CHECK: call i32 @__tsan_atomic32_fetch_nand(i32* %a, i32 0, i32 5), !dbg
   1116 
   1117 define void @atomic32_cas_monotonic(i32* %a) nounwind uwtable {
   1118 entry:
   1119   cmpxchg i32* %a, i32 0, i32 1 monotonic monotonic, !dbg !7
   1120   ret void, !dbg !7
   1121 }
   1122 ; CHECK-LABEL: atomic32_cas_monotonic
   1123 ; CHECK: call i32 @__tsan_atomic32_compare_exchange_val(i32* %a, i32 0, i32 1, i32 0, i32 0), !dbg
   1124 
   1125 define void @atomic32_cas_acquire(i32* %a) nounwind uwtable {
   1126 entry:
   1127   cmpxchg i32* %a, i32 0, i32 1 acquire acquire, !dbg !7
   1128   ret void, !dbg !7
   1129 }
   1130 ; CHECK-LABEL: atomic32_cas_acquire
   1131 ; CHECK: call i32 @__tsan_atomic32_compare_exchange_val(i32* %a, i32 0, i32 1, i32 2, i32 2), !dbg
   1132 
   1133 define void @atomic32_cas_release(i32* %a) nounwind uwtable {
   1134 entry:
   1135   cmpxchg i32* %a, i32 0, i32 1 release monotonic, !dbg !7
   1136   ret void, !dbg !7
   1137 }
   1138 ; CHECK-LABEL: atomic32_cas_release
   1139 ; CHECK: call i32 @__tsan_atomic32_compare_exchange_val(i32* %a, i32 0, i32 1, i32 3, i32 0), !dbg
   1140 
   1141 define void @atomic32_cas_acq_rel(i32* %a) nounwind uwtable {
   1142 entry:
   1143   cmpxchg i32* %a, i32 0, i32 1 acq_rel acquire, !dbg !7
   1144   ret void, !dbg !7
   1145 }
   1146 ; CHECK-LABEL: atomic32_cas_acq_rel
   1147 ; CHECK: call i32 @__tsan_atomic32_compare_exchange_val(i32* %a, i32 0, i32 1, i32 4, i32 2), !dbg
   1148 
   1149 define void @atomic32_cas_seq_cst(i32* %a) nounwind uwtable {
   1150 entry:
   1151   cmpxchg i32* %a, i32 0, i32 1 seq_cst seq_cst, !dbg !7
   1152   ret void, !dbg !7
   1153 }
   1154 ; CHECK-LABEL: atomic32_cas_seq_cst
   1155 ; CHECK: call i32 @__tsan_atomic32_compare_exchange_val(i32* %a, i32 0, i32 1, i32 5, i32 5), !dbg
   1156 
   1157 define i64 @atomic64_load_unordered(i64* %a) nounwind uwtable {
   1158 entry:
   1159   %0 = load atomic i64, i64* %a unordered, align 8, !dbg !7
   1160   ret i64 %0, !dbg !7
   1161 }
   1162 ; CHECK-LABEL: atomic64_load_unordered
   1163 ; CHECK: call i64 @__tsan_atomic64_load(i64* %a, i32 0), !dbg
   1164 
   1165 define i64 @atomic64_load_monotonic(i64* %a) nounwind uwtable {
   1166 entry:
   1167   %0 = load atomic i64, i64* %a monotonic, align 8, !dbg !7
   1168   ret i64 %0, !dbg !7
   1169 }
   1170 ; CHECK-LABEL: atomic64_load_monotonic
   1171 ; CHECK: call i64 @__tsan_atomic64_load(i64* %a, i32 0), !dbg
   1172 
   1173 define i64 @atomic64_load_acquire(i64* %a) nounwind uwtable {
   1174 entry:
   1175   %0 = load atomic i64, i64* %a acquire, align 8, !dbg !7
   1176   ret i64 %0, !dbg !7
   1177 }
   1178 ; CHECK-LABEL: atomic64_load_acquire
   1179 ; CHECK: call i64 @__tsan_atomic64_load(i64* %a, i32 2), !dbg
   1180 
   1181 define i64 @atomic64_load_seq_cst(i64* %a) nounwind uwtable {
   1182 entry:
   1183   %0 = load atomic i64, i64* %a seq_cst, align 8, !dbg !7
   1184   ret i64 %0, !dbg !7
   1185 }
   1186 ; CHECK-LABEL: atomic64_load_seq_cst
   1187 ; CHECK: call i64 @__tsan_atomic64_load(i64* %a, i32 5), !dbg
   1188 
   1189 define i8* @atomic64_load_seq_cst_ptr_ty(i8** %a) nounwind uwtable {
   1190 entry:
   1191   %0 = load atomic i8*, i8** %a seq_cst, align 8, !dbg !7
   1192   ret i8* %0, !dbg !7
   1193 }
   1194 ; CHECK-LABEL: atomic64_load_seq_cst
   1195 ; CHECK: bitcast i8** %{{.+}} to i64*
   1196 ; CHECK-NEXT: call i64 @__tsan_atomic64_load(i64* %{{.+}}, i32 5), !dbg
   1197 ; CHECK-NEXT: inttoptr i64 %{{.+}} to i8*
   1198 
   1199 define void @atomic64_store_unordered(i64* %a) nounwind uwtable {
   1200 entry:
   1201   store atomic i64 0, i64* %a unordered, align 8, !dbg !7
   1202   ret void, !dbg !7
   1203 }
   1204 ; CHECK-LABEL: atomic64_store_unordered
   1205 ; CHECK: call void @__tsan_atomic64_store(i64* %a, i64 0, i32 0), !dbg
   1206 
   1207 define void @atomic64_store_monotonic(i64* %a) nounwind uwtable {
   1208 entry:
   1209   store atomic i64 0, i64* %a monotonic, align 8, !dbg !7
   1210   ret void, !dbg !7
   1211 }
   1212 ; CHECK-LABEL: atomic64_store_monotonic
   1213 ; CHECK: call void @__tsan_atomic64_store(i64* %a, i64 0, i32 0), !dbg
   1214 
   1215 define void @atomic64_store_release(i64* %a) nounwind uwtable {
   1216 entry:
   1217   store atomic i64 0, i64* %a release, align 8, !dbg !7
   1218   ret void, !dbg !7
   1219 }
   1220 ; CHECK-LABEL: atomic64_store_release
   1221 ; CHECK: call void @__tsan_atomic64_store(i64* %a, i64 0, i32 3), !dbg
   1222 
   1223 define void @atomic64_store_seq_cst(i64* %a) nounwind uwtable {
   1224 entry:
   1225   store atomic i64 0, i64* %a seq_cst, align 8, !dbg !7
   1226   ret void, !dbg !7
   1227 }
   1228 ; CHECK-LABEL: atomic64_store_seq_cst
   1229 ; CHECK: call void @__tsan_atomic64_store(i64* %a, i64 0, i32 5), !dbg
   1230 
   1231 define void @atomic64_store_seq_cst_ptr_ty(i8** %a, i8* %v) nounwind uwtable {
   1232 entry:
   1233   store atomic i8* %v, i8** %a seq_cst, align 8, !dbg !7
   1234   ret void, !dbg !7
   1235 }
   1236 ; CHECK-LABEL: atomic64_store_seq_cst
   1237 ; CHECK: %{{.*}} = bitcast i8** %{{.*}} to i64*
   1238 ; CHECK-NEXT: %{{.*}} = ptrtoint i8* %{{.*}} to i64
   1239 ; CHECK-NEXT: call void @__tsan_atomic64_store(i64* %{{.*}}, i64 %{{.*}}, i32 5), !dbg
   1240 
   1241 define void @atomic64_xchg_monotonic(i64* %a) nounwind uwtable {
   1242 entry:
   1243   atomicrmw xchg i64* %a, i64 0 monotonic, !dbg !7
   1244   ret void, !dbg !7
   1245 }
   1246 ; CHECK-LABEL: atomic64_xchg_monotonic
   1247 ; CHECK: call i64 @__tsan_atomic64_exchange(i64* %a, i64 0, i32 0), !dbg
   1248 
   1249 define void @atomic64_add_monotonic(i64* %a) nounwind uwtable {
   1250 entry:
   1251   atomicrmw add i64* %a, i64 0 monotonic, !dbg !7
   1252   ret void, !dbg !7
   1253 }
   1254 ; CHECK-LABEL: atomic64_add_monotonic
   1255 ; CHECK: call i64 @__tsan_atomic64_fetch_add(i64* %a, i64 0, i32 0), !dbg
   1256 
   1257 define void @atomic64_sub_monotonic(i64* %a) nounwind uwtable {
   1258 entry:
   1259   atomicrmw sub i64* %a, i64 0 monotonic, !dbg !7
   1260   ret void, !dbg !7
   1261 }
   1262 ; CHECK-LABEL: atomic64_sub_monotonic
   1263 ; CHECK: call i64 @__tsan_atomic64_fetch_sub(i64* %a, i64 0, i32 0), !dbg
   1264 
   1265 define void @atomic64_and_monotonic(i64* %a) nounwind uwtable {
   1266 entry:
   1267   atomicrmw and i64* %a, i64 0 monotonic, !dbg !7
   1268   ret void, !dbg !7
   1269 }
   1270 ; CHECK-LABEL: atomic64_and_monotonic
   1271 ; CHECK: call i64 @__tsan_atomic64_fetch_and(i64* %a, i64 0, i32 0), !dbg
   1272 
   1273 define void @atomic64_or_monotonic(i64* %a) nounwind uwtable {
   1274 entry:
   1275   atomicrmw or i64* %a, i64 0 monotonic, !dbg !7
   1276   ret void, !dbg !7
   1277 }
   1278 ; CHECK-LABEL: atomic64_or_monotonic
   1279 ; CHECK: call i64 @__tsan_atomic64_fetch_or(i64* %a, i64 0, i32 0), !dbg
   1280 
   1281 define void @atomic64_xor_monotonic(i64* %a) nounwind uwtable {
   1282 entry:
   1283   atomicrmw xor i64* %a, i64 0 monotonic, !dbg !7
   1284   ret void, !dbg !7
   1285 }
   1286 ; CHECK-LABEL: atomic64_xor_monotonic
   1287 ; CHECK: call i64 @__tsan_atomic64_fetch_xor(i64* %a, i64 0, i32 0), !dbg
   1288 
   1289 define void @atomic64_nand_monotonic(i64* %a) nounwind uwtable {
   1290 entry:
   1291   atomicrmw nand i64* %a, i64 0 monotonic, !dbg !7
   1292   ret void, !dbg !7
   1293 }
   1294 ; CHECK-LABEL: atomic64_nand_monotonic
   1295 ; CHECK: call i64 @__tsan_atomic64_fetch_nand(i64* %a, i64 0, i32 0), !dbg
   1296 
   1297 define void @atomic64_xchg_acquire(i64* %a) nounwind uwtable {
   1298 entry:
   1299   atomicrmw xchg i64* %a, i64 0 acquire, !dbg !7
   1300   ret void, !dbg !7
   1301 }
   1302 ; CHECK-LABEL: atomic64_xchg_acquire
   1303 ; CHECK: call i64 @__tsan_atomic64_exchange(i64* %a, i64 0, i32 2), !dbg
   1304 
   1305 define void @atomic64_add_acquire(i64* %a) nounwind uwtable {
   1306 entry:
   1307   atomicrmw add i64* %a, i64 0 acquire, !dbg !7
   1308   ret void, !dbg !7
   1309 }
   1310 ; CHECK-LABEL: atomic64_add_acquire
   1311 ; CHECK: call i64 @__tsan_atomic64_fetch_add(i64* %a, i64 0, i32 2), !dbg
   1312 
   1313 define void @atomic64_sub_acquire(i64* %a) nounwind uwtable {
   1314 entry:
   1315   atomicrmw sub i64* %a, i64 0 acquire, !dbg !7
   1316   ret void, !dbg !7
   1317 }
   1318 ; CHECK-LABEL: atomic64_sub_acquire
   1319 ; CHECK: call i64 @__tsan_atomic64_fetch_sub(i64* %a, i64 0, i32 2), !dbg
   1320 
   1321 define void @atomic64_and_acquire(i64* %a) nounwind uwtable {
   1322 entry:
   1323   atomicrmw and i64* %a, i64 0 acquire, !dbg !7
   1324   ret void, !dbg !7
   1325 }
   1326 ; CHECK-LABEL: atomic64_and_acquire
   1327 ; CHECK: call i64 @__tsan_atomic64_fetch_and(i64* %a, i64 0, i32 2), !dbg
   1328 
   1329 define void @atomic64_or_acquire(i64* %a) nounwind uwtable {
   1330 entry:
   1331   atomicrmw or i64* %a, i64 0 acquire, !dbg !7
   1332   ret void, !dbg !7
   1333 }
   1334 ; CHECK-LABEL: atomic64_or_acquire
   1335 ; CHECK: call i64 @__tsan_atomic64_fetch_or(i64* %a, i64 0, i32 2), !dbg
   1336 
   1337 define void @atomic64_xor_acquire(i64* %a) nounwind uwtable {
   1338 entry:
   1339   atomicrmw xor i64* %a, i64 0 acquire, !dbg !7
   1340   ret void, !dbg !7
   1341 }
   1342 ; CHECK-LABEL: atomic64_xor_acquire
   1343 ; CHECK: call i64 @__tsan_atomic64_fetch_xor(i64* %a, i64 0, i32 2), !dbg
   1344 
   1345 define void @atomic64_nand_acquire(i64* %a) nounwind uwtable {
   1346 entry:
   1347   atomicrmw nand i64* %a, i64 0 acquire, !dbg !7
   1348   ret void, !dbg !7
   1349 }
   1350 ; CHECK-LABEL: atomic64_nand_acquire
   1351 ; CHECK: call i64 @__tsan_atomic64_fetch_nand(i64* %a, i64 0, i32 2), !dbg
   1352 
   1353 define void @atomic64_xchg_release(i64* %a) nounwind uwtable {
   1354 entry:
   1355   atomicrmw xchg i64* %a, i64 0 release, !dbg !7
   1356   ret void, !dbg !7
   1357 }
   1358 ; CHECK-LABEL: atomic64_xchg_release
   1359 ; CHECK: call i64 @__tsan_atomic64_exchange(i64* %a, i64 0, i32 3), !dbg
   1360 
   1361 define void @atomic64_add_release(i64* %a) nounwind uwtable {
   1362 entry:
   1363   atomicrmw add i64* %a, i64 0 release, !dbg !7
   1364   ret void, !dbg !7
   1365 }
   1366 ; CHECK-LABEL: atomic64_add_release
   1367 ; CHECK: call i64 @__tsan_atomic64_fetch_add(i64* %a, i64 0, i32 3), !dbg
   1368 
   1369 define void @atomic64_sub_release(i64* %a) nounwind uwtable {
   1370 entry:
   1371   atomicrmw sub i64* %a, i64 0 release, !dbg !7
   1372   ret void, !dbg !7
   1373 }
   1374 ; CHECK-LABEL: atomic64_sub_release
   1375 ; CHECK: call i64 @__tsan_atomic64_fetch_sub(i64* %a, i64 0, i32 3), !dbg
   1376 
   1377 define void @atomic64_and_release(i64* %a) nounwind uwtable {
   1378 entry:
   1379   atomicrmw and i64* %a, i64 0 release, !dbg !7
   1380   ret void, !dbg !7
   1381 }
   1382 ; CHECK-LABEL: atomic64_and_release
   1383 ; CHECK: call i64 @__tsan_atomic64_fetch_and(i64* %a, i64 0, i32 3), !dbg
   1384 
   1385 define void @atomic64_or_release(i64* %a) nounwind uwtable {
   1386 entry:
   1387   atomicrmw or i64* %a, i64 0 release, !dbg !7
   1388   ret void, !dbg !7
   1389 }
   1390 ; CHECK-LABEL: atomic64_or_release
   1391 ; CHECK: call i64 @__tsan_atomic64_fetch_or(i64* %a, i64 0, i32 3), !dbg
   1392 
   1393 define void @atomic64_xor_release(i64* %a) nounwind uwtable {
   1394 entry:
   1395   atomicrmw xor i64* %a, i64 0 release, !dbg !7
   1396   ret void, !dbg !7
   1397 }
   1398 ; CHECK-LABEL: atomic64_xor_release
   1399 ; CHECK: call i64 @__tsan_atomic64_fetch_xor(i64* %a, i64 0, i32 3), !dbg
   1400 
   1401 define void @atomic64_nand_release(i64* %a) nounwind uwtable {
   1402 entry:
   1403   atomicrmw nand i64* %a, i64 0 release, !dbg !7
   1404   ret void, !dbg !7
   1405 }
   1406 ; CHECK-LABEL: atomic64_nand_release
   1407 ; CHECK: call i64 @__tsan_atomic64_fetch_nand(i64* %a, i64 0, i32 3), !dbg
   1408 
   1409 define void @atomic64_xchg_acq_rel(i64* %a) nounwind uwtable {
   1410 entry:
   1411   atomicrmw xchg i64* %a, i64 0 acq_rel, !dbg !7
   1412   ret void, !dbg !7
   1413 }
   1414 ; CHECK-LABEL: atomic64_xchg_acq_rel
   1415 ; CHECK: call i64 @__tsan_atomic64_exchange(i64* %a, i64 0, i32 4), !dbg
   1416 
   1417 define void @atomic64_add_acq_rel(i64* %a) nounwind uwtable {
   1418 entry:
   1419   atomicrmw add i64* %a, i64 0 acq_rel, !dbg !7
   1420   ret void, !dbg !7
   1421 }
   1422 ; CHECK-LABEL: atomic64_add_acq_rel
   1423 ; CHECK: call i64 @__tsan_atomic64_fetch_add(i64* %a, i64 0, i32 4), !dbg
   1424 
   1425 define void @atomic64_sub_acq_rel(i64* %a) nounwind uwtable {
   1426 entry:
   1427   atomicrmw sub i64* %a, i64 0 acq_rel, !dbg !7
   1428   ret void, !dbg !7
   1429 }
   1430 ; CHECK-LABEL: atomic64_sub_acq_rel
   1431 ; CHECK: call i64 @__tsan_atomic64_fetch_sub(i64* %a, i64 0, i32 4), !dbg
   1432 
   1433 define void @atomic64_and_acq_rel(i64* %a) nounwind uwtable {
   1434 entry:
   1435   atomicrmw and i64* %a, i64 0 acq_rel, !dbg !7
   1436   ret void, !dbg !7
   1437 }
   1438 ; CHECK-LABEL: atomic64_and_acq_rel
   1439 ; CHECK: call i64 @__tsan_atomic64_fetch_and(i64* %a, i64 0, i32 4), !dbg
   1440 
   1441 define void @atomic64_or_acq_rel(i64* %a) nounwind uwtable {
   1442 entry:
   1443   atomicrmw or i64* %a, i64 0 acq_rel, !dbg !7
   1444   ret void, !dbg !7
   1445 }
   1446 ; CHECK-LABEL: atomic64_or_acq_rel
   1447 ; CHECK: call i64 @__tsan_atomic64_fetch_or(i64* %a, i64 0, i32 4), !dbg
   1448 
   1449 define void @atomic64_xor_acq_rel(i64* %a) nounwind uwtable {
   1450 entry:
   1451   atomicrmw xor i64* %a, i64 0 acq_rel, !dbg !7
   1452   ret void, !dbg !7
   1453 }
   1454 ; CHECK-LABEL: atomic64_xor_acq_rel
   1455 ; CHECK: call i64 @__tsan_atomic64_fetch_xor(i64* %a, i64 0, i32 4), !dbg
   1456 
   1457 define void @atomic64_nand_acq_rel(i64* %a) nounwind uwtable {
   1458 entry:
   1459   atomicrmw nand i64* %a, i64 0 acq_rel, !dbg !7
   1460   ret void, !dbg !7
   1461 }
   1462 ; CHECK-LABEL: atomic64_nand_acq_rel
   1463 ; CHECK: call i64 @__tsan_atomic64_fetch_nand(i64* %a, i64 0, i32 4), !dbg
   1464 
   1465 define void @atomic64_xchg_seq_cst(i64* %a) nounwind uwtable {
   1466 entry:
   1467   atomicrmw xchg i64* %a, i64 0 seq_cst, !dbg !7
   1468   ret void, !dbg !7
   1469 }
   1470 ; CHECK-LABEL: atomic64_xchg_seq_cst
   1471 ; CHECK: call i64 @__tsan_atomic64_exchange(i64* %a, i64 0, i32 5), !dbg
   1472 
   1473 define void @atomic64_add_seq_cst(i64* %a) nounwind uwtable {
   1474 entry:
   1475   atomicrmw add i64* %a, i64 0 seq_cst, !dbg !7
   1476   ret void, !dbg !7
   1477 }
   1478 ; CHECK-LABEL: atomic64_add_seq_cst
   1479 ; CHECK: call i64 @__tsan_atomic64_fetch_add(i64* %a, i64 0, i32 5), !dbg
   1480 
   1481 define void @atomic64_sub_seq_cst(i64* %a) nounwind uwtable {
   1482 entry:
   1483   atomicrmw sub i64* %a, i64 0 seq_cst, !dbg !7
   1484   ret void, !dbg !7
   1485 }
   1486 ; CHECK-LABEL: atomic64_sub_seq_cst
   1487 ; CHECK: call i64 @__tsan_atomic64_fetch_sub(i64* %a, i64 0, i32 5), !dbg
   1488 
   1489 define void @atomic64_and_seq_cst(i64* %a) nounwind uwtable {
   1490 entry:
   1491   atomicrmw and i64* %a, i64 0 seq_cst, !dbg !7
   1492   ret void, !dbg !7
   1493 }
   1494 ; CHECK-LABEL: atomic64_and_seq_cst
   1495 ; CHECK: call i64 @__tsan_atomic64_fetch_and(i64* %a, i64 0, i32 5), !dbg
   1496 
   1497 define void @atomic64_or_seq_cst(i64* %a) nounwind uwtable {
   1498 entry:
   1499   atomicrmw or i64* %a, i64 0 seq_cst, !dbg !7
   1500   ret void, !dbg !7
   1501 }
   1502 ; CHECK-LABEL: atomic64_or_seq_cst
   1503 ; CHECK: call i64 @__tsan_atomic64_fetch_or(i64* %a, i64 0, i32 5), !dbg
   1504 
   1505 define void @atomic64_xor_seq_cst(i64* %a) nounwind uwtable {
   1506 entry:
   1507   atomicrmw xor i64* %a, i64 0 seq_cst, !dbg !7
   1508   ret void, !dbg !7
   1509 }
   1510 ; CHECK-LABEL: atomic64_xor_seq_cst
   1511 ; CHECK: call i64 @__tsan_atomic64_fetch_xor(i64* %a, i64 0, i32 5), !dbg
   1512 
   1513 define void @atomic64_nand_seq_cst(i64* %a) nounwind uwtable {
   1514 entry:
   1515   atomicrmw nand i64* %a, i64 0 seq_cst, !dbg !7
   1516   ret void, !dbg !7
   1517 }
   1518 ; CHECK-LABEL: atomic64_nand_seq_cst
   1519 ; CHECK: call i64 @__tsan_atomic64_fetch_nand(i64* %a, i64 0, i32 5), !dbg
   1520 
   1521 define void @atomic64_cas_monotonic(i64* %a) nounwind uwtable {
   1522 entry:
   1523   cmpxchg i64* %a, i64 0, i64 1 monotonic monotonic, !dbg !7
   1524   ret void, !dbg !7
   1525 }
   1526 ; CHECK-LABEL: atomic64_cas_monotonic
   1527 ; CHECK: call i64 @__tsan_atomic64_compare_exchange_val(i64* %a, i64 0, i64 1, i32 0, i32 0), !dbg
   1528 
   1529 define void @atomic64_cas_acquire(i64* %a) nounwind uwtable {
   1530 entry:
   1531   cmpxchg i64* %a, i64 0, i64 1 acquire acquire, !dbg !7
   1532   ret void, !dbg !7
   1533 }
   1534 ; CHECK-LABEL: atomic64_cas_acquire
   1535 ; CHECK: call i64 @__tsan_atomic64_compare_exchange_val(i64* %a, i64 0, i64 1, i32 2, i32 2), !dbg
   1536 
   1537 define void @atomic64_cas_release(i64* %a) nounwind uwtable {
   1538 entry:
   1539   cmpxchg i64* %a, i64 0, i64 1 release monotonic, !dbg !7
   1540   ret void, !dbg !7
   1541 }
   1542 ; CHECK-LABEL: atomic64_cas_release
   1543 ; CHECK: call i64 @__tsan_atomic64_compare_exchange_val(i64* %a, i64 0, i64 1, i32 3, i32 0), !dbg
   1544 
   1545 define void @atomic64_cas_acq_rel(i64* %a) nounwind uwtable {
   1546 entry:
   1547   cmpxchg i64* %a, i64 0, i64 1 acq_rel acquire, !dbg !7
   1548   ret void, !dbg !7
   1549 }
   1550 ; CHECK-LABEL: atomic64_cas_acq_rel
   1551 ; CHECK: call i64 @__tsan_atomic64_compare_exchange_val(i64* %a, i64 0, i64 1, i32 4, i32 2), !dbg
   1552 
   1553 define void @atomic64_cas_seq_cst(i64* %a) nounwind uwtable {
   1554 entry:
   1555   cmpxchg i64* %a, i64 0, i64 1 seq_cst seq_cst, !dbg !7
   1556   ret void, !dbg !7
   1557 }
   1558 ; CHECK-LABEL: atomic64_cas_seq_cst
   1559 ; CHECK: call i64 @__tsan_atomic64_compare_exchange_val(i64* %a, i64 0, i64 1, i32 5, i32 5), !dbg
   1560 
   1561 define void @atomic64_cas_seq_cst_ptr_ty(i8** %a, i8* %v1, i8* %v2) nounwind uwtable {
   1562 entry:
   1563   cmpxchg i8** %a, i8* %v1, i8* %v2 seq_cst seq_cst, !dbg !7
   1564   ret void
   1565 }
   1566 ; CHECK-LABEL: atomic64_cas_seq_cst
   1567 ; CHECK: {{.*}} = ptrtoint i8* %v1 to i64
   1568 ; CHECK-NEXT: {{.*}} = ptrtoint i8* %v2 to i64
   1569 ; CHECK-NEXT: {{.*}} = bitcast i8** %a to i64*
   1570 ; CHECK-NEXT: {{.*}} = call i64 @__tsan_atomic64_compare_exchange_val(i64* {{.*}}, i64 {{.*}}, i64 {{.*}}, i32 5, i32 5), !dbg
   1571 ; CHECK-NEXT: {{.*}} = icmp eq i64
   1572 ; CHECK-NEXT: {{.*}} = inttoptr i64 {{.*}} to i8*
   1573 ; CHECK-NEXT: {{.*}} = insertvalue { i8*, i1 } undef, i8* {{.*}}, 0
   1574 ; CHECK-NEXT: {{.*}} = insertvalue { i8*, i1 } {{.*}}, i1 {{.*}}, 1
   1575 
   1576 define i128 @atomic128_load_unordered(i128* %a) nounwind uwtable {
   1577 entry:
   1578   %0 = load atomic i128, i128* %a unordered, align 16, !dbg !7
   1579   ret i128 %0, !dbg !7
   1580 }
   1581 ; CHECK-LABEL: atomic128_load_unordered
   1582 ; CHECK: call i128 @__tsan_atomic128_load(i128* %a, i32 0), !dbg
   1583 
   1584 define i128 @atomic128_load_monotonic(i128* %a) nounwind uwtable {
   1585 entry:
   1586   %0 = load atomic i128, i128* %a monotonic, align 16, !dbg !7
   1587   ret i128 %0, !dbg !7
   1588 }
   1589 ; CHECK-LABEL: atomic128_load_monotonic
   1590 ; CHECK: call i128 @__tsan_atomic128_load(i128* %a, i32 0), !dbg
   1591 
   1592 define i128 @atomic128_load_acquire(i128* %a) nounwind uwtable {
   1593 entry:
   1594   %0 = load atomic i128, i128* %a acquire, align 16, !dbg !7
   1595   ret i128 %0, !dbg !7
   1596 }
   1597 ; CHECK-LABEL: atomic128_load_acquire
   1598 ; CHECK: call i128 @__tsan_atomic128_load(i128* %a, i32 2), !dbg
   1599 
   1600 define i128 @atomic128_load_seq_cst(i128* %a) nounwind uwtable {
   1601 entry:
   1602   %0 = load atomic i128, i128* %a seq_cst, align 16, !dbg !7
   1603   ret i128 %0, !dbg !7
   1604 }
   1605 ; CHECK-LABEL: atomic128_load_seq_cst
   1606 ; CHECK: call i128 @__tsan_atomic128_load(i128* %a, i32 5), !dbg
   1607 
   1608 define void @atomic128_store_unordered(i128* %a) nounwind uwtable {
   1609 entry:
   1610   store atomic i128 0, i128* %a unordered, align 16, !dbg !7
   1611   ret void, !dbg !7
   1612 }
   1613 ; CHECK-LABEL: atomic128_store_unordered
   1614 ; CHECK: call void @__tsan_atomic128_store(i128* %a, i128 0, i32 0), !dbg
   1615 
   1616 define void @atomic128_store_monotonic(i128* %a) nounwind uwtable {
   1617 entry:
   1618   store atomic i128 0, i128* %a monotonic, align 16, !dbg !7
   1619   ret void, !dbg !7
   1620 }
   1621 ; CHECK-LABEL: atomic128_store_monotonic
   1622 ; CHECK: call void @__tsan_atomic128_store(i128* %a, i128 0, i32 0), !dbg
   1623 
   1624 define void @atomic128_store_release(i128* %a) nounwind uwtable {
   1625 entry:
   1626   store atomic i128 0, i128* %a release, align 16, !dbg !7
   1627   ret void, !dbg !7
   1628 }
   1629 ; CHECK-LABEL: atomic128_store_release
   1630 ; CHECK: call void @__tsan_atomic128_store(i128* %a, i128 0, i32 3), !dbg
   1631 
   1632 define void @atomic128_store_seq_cst(i128* %a) nounwind uwtable {
   1633 entry:
   1634   store atomic i128 0, i128* %a seq_cst, align 16, !dbg !7
   1635   ret void, !dbg !7
   1636 }
   1637 ; CHECK-LABEL: atomic128_store_seq_cst
   1638 ; CHECK: call void @__tsan_atomic128_store(i128* %a, i128 0, i32 5), !dbg
   1639 
   1640 define void @atomic128_xchg_monotonic(i128* %a) nounwind uwtable {
   1641 entry:
   1642   atomicrmw xchg i128* %a, i128 0 monotonic, !dbg !7
   1643   ret void, !dbg !7
   1644 }
   1645 ; CHECK-LABEL: atomic128_xchg_monotonic
   1646 ; CHECK: call i128 @__tsan_atomic128_exchange(i128* %a, i128 0, i32 0), !dbg
   1647 
   1648 define void @atomic128_add_monotonic(i128* %a) nounwind uwtable {
   1649 entry:
   1650   atomicrmw add i128* %a, i128 0 monotonic, !dbg !7
   1651   ret void, !dbg !7
   1652 }
   1653 ; CHECK-LABEL: atomic128_add_monotonic
   1654 ; CHECK: call i128 @__tsan_atomic128_fetch_add(i128* %a, i128 0, i32 0), !dbg
   1655 
   1656 define void @atomic128_sub_monotonic(i128* %a) nounwind uwtable {
   1657 entry:
   1658   atomicrmw sub i128* %a, i128 0 monotonic, !dbg !7
   1659   ret void, !dbg !7
   1660 }
   1661 ; CHECK-LABEL: atomic128_sub_monotonic
   1662 ; CHECK: call i128 @__tsan_atomic128_fetch_sub(i128* %a, i128 0, i32 0), !dbg
   1663 
   1664 define void @atomic128_and_monotonic(i128* %a) nounwind uwtable {
   1665 entry:
   1666   atomicrmw and i128* %a, i128 0 monotonic, !dbg !7
   1667   ret void, !dbg !7
   1668 }
   1669 ; CHECK-LABEL: atomic128_and_monotonic
   1670 ; CHECK: call i128 @__tsan_atomic128_fetch_and(i128* %a, i128 0, i32 0), !dbg
   1671 
   1672 define void @atomic128_or_monotonic(i128* %a) nounwind uwtable {
   1673 entry:
   1674   atomicrmw or i128* %a, i128 0 monotonic, !dbg !7
   1675   ret void, !dbg !7
   1676 }
   1677 ; CHECK-LABEL: atomic128_or_monotonic
   1678 ; CHECK: call i128 @__tsan_atomic128_fetch_or(i128* %a, i128 0, i32 0), !dbg
   1679 
   1680 define void @atomic128_xor_monotonic(i128* %a) nounwind uwtable {
   1681 entry:
   1682   atomicrmw xor i128* %a, i128 0 monotonic, !dbg !7
   1683   ret void, !dbg !7
   1684 }
   1685 ; CHECK-LABEL: atomic128_xor_monotonic
   1686 ; CHECK: call i128 @__tsan_atomic128_fetch_xor(i128* %a, i128 0, i32 0), !dbg
   1687 
   1688 define void @atomic128_nand_monotonic(i128* %a) nounwind uwtable {
   1689 entry:
   1690   atomicrmw nand i128* %a, i128 0 monotonic, !dbg !7
   1691   ret void, !dbg !7
   1692 }
   1693 ; CHECK-LABEL: atomic128_nand_monotonic
   1694 ; CHECK: call i128 @__tsan_atomic128_fetch_nand(i128* %a, i128 0, i32 0), !dbg
   1695 
   1696 define void @atomic128_xchg_acquire(i128* %a) nounwind uwtable {
   1697 entry:
   1698   atomicrmw xchg i128* %a, i128 0 acquire, !dbg !7
   1699   ret void, !dbg !7
   1700 }
   1701 ; CHECK-LABEL: atomic128_xchg_acquire
   1702 ; CHECK: call i128 @__tsan_atomic128_exchange(i128* %a, i128 0, i32 2), !dbg
   1703 
   1704 define void @atomic128_add_acquire(i128* %a) nounwind uwtable {
   1705 entry:
   1706   atomicrmw add i128* %a, i128 0 acquire, !dbg !7
   1707   ret void, !dbg !7
   1708 }
   1709 ; CHECK-LABEL: atomic128_add_acquire
   1710 ; CHECK: call i128 @__tsan_atomic128_fetch_add(i128* %a, i128 0, i32 2), !dbg
   1711 
   1712 define void @atomic128_sub_acquire(i128* %a) nounwind uwtable {
   1713 entry:
   1714   atomicrmw sub i128* %a, i128 0 acquire, !dbg !7
   1715   ret void, !dbg !7
   1716 }
   1717 ; CHECK-LABEL: atomic128_sub_acquire
   1718 ; CHECK: call i128 @__tsan_atomic128_fetch_sub(i128* %a, i128 0, i32 2), !dbg
   1719 
   1720 define void @atomic128_and_acquire(i128* %a) nounwind uwtable {
   1721 entry:
   1722   atomicrmw and i128* %a, i128 0 acquire, !dbg !7
   1723   ret void, !dbg !7
   1724 }
   1725 ; CHECK-LABEL: atomic128_and_acquire
   1726 ; CHECK: call i128 @__tsan_atomic128_fetch_and(i128* %a, i128 0, i32 2), !dbg
   1727 
   1728 define void @atomic128_or_acquire(i128* %a) nounwind uwtable {
   1729 entry:
   1730   atomicrmw or i128* %a, i128 0 acquire, !dbg !7
   1731   ret void, !dbg !7
   1732 }
   1733 ; CHECK-LABEL: atomic128_or_acquire
   1734 ; CHECK: call i128 @__tsan_atomic128_fetch_or(i128* %a, i128 0, i32 2), !dbg
   1735 
   1736 define void @atomic128_xor_acquire(i128* %a) nounwind uwtable {
   1737 entry:
   1738   atomicrmw xor i128* %a, i128 0 acquire, !dbg !7
   1739   ret void, !dbg !7
   1740 }
   1741 ; CHECK-LABEL: atomic128_xor_acquire
   1742 ; CHECK: call i128 @__tsan_atomic128_fetch_xor(i128* %a, i128 0, i32 2), !dbg
   1743 
   1744 define void @atomic128_nand_acquire(i128* %a) nounwind uwtable {
   1745 entry:
   1746   atomicrmw nand i128* %a, i128 0 acquire, !dbg !7
   1747   ret void, !dbg !7
   1748 }
   1749 ; CHECK-LABEL: atomic128_nand_acquire
   1750 ; CHECK: call i128 @__tsan_atomic128_fetch_nand(i128* %a, i128 0, i32 2), !dbg
   1751 
   1752 define void @atomic128_xchg_release(i128* %a) nounwind uwtable {
   1753 entry:
   1754   atomicrmw xchg i128* %a, i128 0 release, !dbg !7
   1755   ret void, !dbg !7
   1756 }
   1757 ; CHECK-LABEL: atomic128_xchg_release
   1758 ; CHECK: call i128 @__tsan_atomic128_exchange(i128* %a, i128 0, i32 3), !dbg
   1759 
   1760 define void @atomic128_add_release(i128* %a) nounwind uwtable {
   1761 entry:
   1762   atomicrmw add i128* %a, i128 0 release, !dbg !7
   1763   ret void, !dbg !7
   1764 }
   1765 ; CHECK-LABEL: atomic128_add_release
   1766 ; CHECK: call i128 @__tsan_atomic128_fetch_add(i128* %a, i128 0, i32 3), !dbg
   1767 
   1768 define void @atomic128_sub_release(i128* %a) nounwind uwtable {
   1769 entry:
   1770   atomicrmw sub i128* %a, i128 0 release, !dbg !7
   1771   ret void, !dbg !7
   1772 }
   1773 ; CHECK-LABEL: atomic128_sub_release
   1774 ; CHECK: call i128 @__tsan_atomic128_fetch_sub(i128* %a, i128 0, i32 3), !dbg
   1775 
   1776 define void @atomic128_and_release(i128* %a) nounwind uwtable {
   1777 entry:
   1778   atomicrmw and i128* %a, i128 0 release, !dbg !7
   1779   ret void, !dbg !7
   1780 }
   1781 ; CHECK-LABEL: atomic128_and_release
   1782 ; CHECK: call i128 @__tsan_atomic128_fetch_and(i128* %a, i128 0, i32 3), !dbg
   1783 
   1784 define void @atomic128_or_release(i128* %a) nounwind uwtable {
   1785 entry:
   1786   atomicrmw or i128* %a, i128 0 release, !dbg !7
   1787   ret void, !dbg !7
   1788 }
   1789 ; CHECK-LABEL: atomic128_or_release
   1790 ; CHECK: call i128 @__tsan_atomic128_fetch_or(i128* %a, i128 0, i32 3), !dbg
   1791 
   1792 define void @atomic128_xor_release(i128* %a) nounwind uwtable {
   1793 entry:
   1794   atomicrmw xor i128* %a, i128 0 release, !dbg !7
   1795   ret void, !dbg !7
   1796 }
   1797 ; CHECK-LABEL: atomic128_xor_release
   1798 ; CHECK: call i128 @__tsan_atomic128_fetch_xor(i128* %a, i128 0, i32 3), !dbg
   1799 
   1800 define void @atomic128_nand_release(i128* %a) nounwind uwtable {
   1801 entry:
   1802   atomicrmw nand i128* %a, i128 0 release, !dbg !7
   1803   ret void, !dbg !7
   1804 }
   1805 ; CHECK-LABEL: atomic128_nand_release
   1806 ; CHECK: call i128 @__tsan_atomic128_fetch_nand(i128* %a, i128 0, i32 3), !dbg
   1807 
   1808 define void @atomic128_xchg_acq_rel(i128* %a) nounwind uwtable {
   1809 entry:
   1810   atomicrmw xchg i128* %a, i128 0 acq_rel, !dbg !7
   1811   ret void, !dbg !7
   1812 }
   1813 ; CHECK-LABEL: atomic128_xchg_acq_rel
   1814 ; CHECK: call i128 @__tsan_atomic128_exchange(i128* %a, i128 0, i32 4), !dbg
   1815 
   1816 define void @atomic128_add_acq_rel(i128* %a) nounwind uwtable {
   1817 entry:
   1818   atomicrmw add i128* %a, i128 0 acq_rel, !dbg !7
   1819   ret void, !dbg !7
   1820 }
   1821 ; CHECK-LABEL: atomic128_add_acq_rel
   1822 ; CHECK: call i128 @__tsan_atomic128_fetch_add(i128* %a, i128 0, i32 4), !dbg
   1823 
   1824 define void @atomic128_sub_acq_rel(i128* %a) nounwind uwtable {
   1825 entry:
   1826   atomicrmw sub i128* %a, i128 0 acq_rel, !dbg !7
   1827   ret void, !dbg !7
   1828 }
   1829 ; CHECK-LABEL: atomic128_sub_acq_rel
   1830 ; CHECK: call i128 @__tsan_atomic128_fetch_sub(i128* %a, i128 0, i32 4), !dbg
   1831 
   1832 define void @atomic128_and_acq_rel(i128* %a) nounwind uwtable {
   1833 entry:
   1834   atomicrmw and i128* %a, i128 0 acq_rel, !dbg !7
   1835   ret void, !dbg !7
   1836 }
   1837 ; CHECK-LABEL: atomic128_and_acq_rel
   1838 ; CHECK: call i128 @__tsan_atomic128_fetch_and(i128* %a, i128 0, i32 4), !dbg
   1839 
   1840 define void @atomic128_or_acq_rel(i128* %a) nounwind uwtable {
   1841 entry:
   1842   atomicrmw or i128* %a, i128 0 acq_rel, !dbg !7
   1843   ret void, !dbg !7
   1844 }
   1845 ; CHECK-LABEL: atomic128_or_acq_rel
   1846 ; CHECK: call i128 @__tsan_atomic128_fetch_or(i128* %a, i128 0, i32 4), !dbg
   1847 
   1848 define void @atomic128_xor_acq_rel(i128* %a) nounwind uwtable {
   1849 entry:
   1850   atomicrmw xor i128* %a, i128 0 acq_rel, !dbg !7
   1851   ret void, !dbg !7
   1852 }
   1853 ; CHECK-LABEL: atomic128_xor_acq_rel
   1854 ; CHECK: call i128 @__tsan_atomic128_fetch_xor(i128* %a, i128 0, i32 4), !dbg
   1855 
   1856 define void @atomic128_nand_acq_rel(i128* %a) nounwind uwtable {
   1857 entry:
   1858   atomicrmw nand i128* %a, i128 0 acq_rel, !dbg !7
   1859   ret void, !dbg !7
   1860 }
   1861 ; CHECK-LABEL: atomic128_nand_acq_rel
   1862 ; CHECK: call i128 @__tsan_atomic128_fetch_nand(i128* %a, i128 0, i32 4), !dbg
   1863 
   1864 define void @atomic128_xchg_seq_cst(i128* %a) nounwind uwtable {
   1865 entry:
   1866   atomicrmw xchg i128* %a, i128 0 seq_cst, !dbg !7
   1867   ret void, !dbg !7
   1868 }
   1869 ; CHECK-LABEL: atomic128_xchg_seq_cst
   1870 ; CHECK: call i128 @__tsan_atomic128_exchange(i128* %a, i128 0, i32 5), !dbg
   1871 
   1872 define void @atomic128_add_seq_cst(i128* %a) nounwind uwtable {
   1873 entry:
   1874   atomicrmw add i128* %a, i128 0 seq_cst, !dbg !7
   1875   ret void, !dbg !7
   1876 }
   1877 ; CHECK-LABEL: atomic128_add_seq_cst
   1878 ; CHECK: call i128 @__tsan_atomic128_fetch_add(i128* %a, i128 0, i32 5), !dbg
   1879 
   1880 define void @atomic128_sub_seq_cst(i128* %a) nounwind uwtable {
   1881 entry:
   1882   atomicrmw sub i128* %a, i128 0 seq_cst, !dbg !7
   1883   ret void, !dbg !7
   1884 }
   1885 ; CHECK-LABEL: atomic128_sub_seq_cst
   1886 ; CHECK: call i128 @__tsan_atomic128_fetch_sub(i128* %a, i128 0, i32 5), !dbg
   1887 
   1888 define void @atomic128_and_seq_cst(i128* %a) nounwind uwtable {
   1889 entry:
   1890   atomicrmw and i128* %a, i128 0 seq_cst, !dbg !7
   1891   ret void, !dbg !7
   1892 }
   1893 ; CHECK-LABEL: atomic128_and_seq_cst
   1894 ; CHECK: call i128 @__tsan_atomic128_fetch_and(i128* %a, i128 0, i32 5), !dbg
   1895 
   1896 define void @atomic128_or_seq_cst(i128* %a) nounwind uwtable {
   1897 entry:
   1898   atomicrmw or i128* %a, i128 0 seq_cst, !dbg !7
   1899   ret void, !dbg !7
   1900 }
   1901 ; CHECK-LABEL: atomic128_or_seq_cst
   1902 ; CHECK: call i128 @__tsan_atomic128_fetch_or(i128* %a, i128 0, i32 5), !dbg
   1903 
   1904 define void @atomic128_xor_seq_cst(i128* %a) nounwind uwtable {
   1905 entry:
   1906   atomicrmw xor i128* %a, i128 0 seq_cst, !dbg !7
   1907   ret void, !dbg !7
   1908 }
   1909 ; CHECK-LABEL: atomic128_xor_seq_cst
   1910 ; CHECK: call i128 @__tsan_atomic128_fetch_xor(i128* %a, i128 0, i32 5), !dbg
   1911 
   1912 define void @atomic128_nand_seq_cst(i128* %a) nounwind uwtable {
   1913 entry:
   1914   atomicrmw nand i128* %a, i128 0 seq_cst, !dbg !7
   1915   ret void, !dbg !7
   1916 }
   1917 ; CHECK-LABEL: atomic128_nand_seq_cst
   1918 ; CHECK: call i128 @__tsan_atomic128_fetch_nand(i128* %a, i128 0, i32 5), !dbg
   1919 
   1920 define void @atomic128_cas_monotonic(i128* %a) nounwind uwtable {
   1921 entry:
   1922   cmpxchg i128* %a, i128 0, i128 1 monotonic monotonic, !dbg !7
   1923   ret void, !dbg !7
   1924 }
   1925 ; CHECK-LABEL: atomic128_cas_monotonic
   1926 ; CHECK: call i128 @__tsan_atomic128_compare_exchange_val(i128* %a, i128 0, i128 1, i32 0, i32 0), !dbg
   1927 
   1928 define void @atomic128_cas_acquire(i128* %a) nounwind uwtable {
   1929 entry:
   1930   cmpxchg i128* %a, i128 0, i128 1 acquire acquire, !dbg !7
   1931   ret void, !dbg !7
   1932 }
   1933 ; CHECK-LABEL: atomic128_cas_acquire
   1934 ; CHECK: call i128 @__tsan_atomic128_compare_exchange_val(i128* %a, i128 0, i128 1, i32 2, i32 2), !dbg
   1935 
   1936 define void @atomic128_cas_release(i128* %a) nounwind uwtable {
   1937 entry:
   1938   cmpxchg i128* %a, i128 0, i128 1 release monotonic, !dbg !7
   1939   ret void, !dbg !7
   1940 }
   1941 ; CHECK-LABEL: atomic128_cas_release
   1942 ; CHECK: call i128 @__tsan_atomic128_compare_exchange_val(i128* %a, i128 0, i128 1, i32 3, i32 0), !dbg
   1943 
   1944 define void @atomic128_cas_acq_rel(i128* %a) nounwind uwtable {
   1945 entry:
   1946   cmpxchg i128* %a, i128 0, i128 1 acq_rel acquire, !dbg !7
   1947   ret void, !dbg !7
   1948 }
   1949 ; CHECK-LABEL: atomic128_cas_acq_rel
   1950 ; CHECK: call i128 @__tsan_atomic128_compare_exchange_val(i128* %a, i128 0, i128 1, i32 4, i32 2), !dbg
   1951 
   1952 define void @atomic128_cas_seq_cst(i128* %a) nounwind uwtable {
   1953 entry:
   1954   cmpxchg i128* %a, i128 0, i128 1 seq_cst seq_cst, !dbg !7
   1955   ret void, !dbg !7
   1956 }
   1957 ; CHECK-LABEL: atomic128_cas_seq_cst
   1958 ; CHECK: call i128 @__tsan_atomic128_compare_exchange_val(i128* %a, i128 0, i128 1, i32 5, i32 5), !dbg
   1959 
   1960 define void @atomic_signal_fence_acquire() nounwind uwtable {
   1961 entry:
   1962   fence singlethread acquire, !dbg !7
   1963   ret void, !dbg !7
   1964 }
   1965 ; CHECK-LABEL: atomic_signal_fence_acquire
   1966 ; CHECK: call void @__tsan_atomic_signal_fence(i32 2), !dbg
   1967 
   1968 define void @atomic_thread_fence_acquire() nounwind uwtable {
   1969 entry:
   1970   fence  acquire, !dbg !7
   1971   ret void, !dbg !7
   1972 }
   1973 ; CHECK-LABEL: atomic_thread_fence_acquire
   1974 ; CHECK: call void @__tsan_atomic_thread_fence(i32 2), !dbg
   1975 
   1976 define void @atomic_signal_fence_release() nounwind uwtable {
   1977 entry:
   1978   fence singlethread release, !dbg !7
   1979   ret void, !dbg !7
   1980 }
   1981 ; CHECK-LABEL: atomic_signal_fence_release
   1982 ; CHECK: call void @__tsan_atomic_signal_fence(i32 3), !dbg
   1983 
   1984 define void @atomic_thread_fence_release() nounwind uwtable {
   1985 entry:
   1986   fence  release, !dbg !7
   1987   ret void, !dbg !7
   1988 }
   1989 ; CHECK-LABEL: atomic_thread_fence_release
   1990 ; CHECK: call void @__tsan_atomic_thread_fence(i32 3), !dbg
   1991 
   1992 define void @atomic_signal_fence_acq_rel() nounwind uwtable {
   1993 entry:
   1994   fence singlethread acq_rel, !dbg !7
   1995   ret void, !dbg !7
   1996 }
   1997 ; CHECK-LABEL: atomic_signal_fence_acq_rel
   1998 ; CHECK: call void @__tsan_atomic_signal_fence(i32 4), !dbg
   1999 
   2000 define void @atomic_thread_fence_acq_rel() nounwind uwtable {
   2001 entry:
   2002   fence  acq_rel, !dbg !7
   2003   ret void, !dbg !7
   2004 }
   2005 ; CHECK-LABEL: atomic_thread_fence_acq_rel
   2006 ; CHECK: call void @__tsan_atomic_thread_fence(i32 4), !dbg
   2007 
   2008 define void @atomic_signal_fence_seq_cst() nounwind uwtable {
   2009 entry:
   2010   fence singlethread seq_cst, !dbg !7
   2011   ret void, !dbg !7
   2012 }
   2013 ; CHECK-LABEL: atomic_signal_fence_seq_cst
   2014 ; CHECK: call void @__tsan_atomic_signal_fence(i32 5), !dbg
   2015 
   2016 define void @atomic_thread_fence_seq_cst() nounwind uwtable {
   2017 entry:
   2018   fence  seq_cst, !dbg !7
   2019   ret void, !dbg !7
   2020 }
   2021 ; CHECK-LABEL: atomic_thread_fence_seq_cst
   2022 ; CHECK: call void @__tsan_atomic_thread_fence(i32 5), !dbg
   2023 
   2024 !llvm.module.flags = !{!0, !1, !2}
   2025 !llvm.dbg.cu = !{!8}
   2026 !0 = !{i32 2, !"Dwarf Version", i32 4}
   2027 !1 = !{i32 2, !"Debug Info Version", i32 3}
   2028 !2 = !{i32 1, !"PIC Level", i32 2}
   2029 
   2030 !3 = !{}
   2031 !4 = !DISubroutineType(types: !3)
   2032 !5 = !DIFile(filename: "atomic.cpp", directory: "/tmp")
   2033 !6 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 99, type: !4, isLocal: false, isDefinition: true, scopeLine: 100, flags: DIFlagPrototyped, isOptimized: false, unit: !8, variables: !3)
   2034 !7 = !DILocation(line: 100, column: 1, scope: !6)
   2035 
   2036 !8 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
   2037                              file: !5,
   2038                              isOptimized: true, flags: "-O2",
   2039                              splitDebugFilename: "abc.debug", emissionKind: 2)
   2040