Home | History | Annotate | Download | only in CodeGen
      1 // RUN: %clang_cc1 -triple powerpc-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=PPC32
      2 // RUN: %clang_cc1 -triple powerpc64-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=PPC64
      3 // RUN: %clang_cc1 -triple mipsel-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=MIPS32
      4 // RUN: %clang_cc1 -triple mips64el-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=MIPS64
      5 
      6 unsigned char c1, c2;
      7 unsigned short s1, s2;
      8 unsigned int i1, i2;
      9 unsigned long long ll1, ll2;
     10 
     11 enum memory_order {
     12   memory_order_relaxed,
     13   memory_order_consume,
     14   memory_order_acquire,
     15   memory_order_release,
     16   memory_order_acq_rel,
     17   memory_order_seq_cst
     18 };
     19 
     20 void test1(void) {
     21   (void)__atomic_load(&c1, &c2, memory_order_seq_cst);
     22   (void)__atomic_load(&s1, &s2, memory_order_seq_cst);
     23   (void)__atomic_load(&i1, &i2, memory_order_seq_cst);
     24   (void)__atomic_load(&ll1, &ll2, memory_order_seq_cst);
     25 
     26 // PPC32: define void @test1
     27 // PPC32: load atomic i8* @c1 seq_cst
     28 // PPC32: load atomic i16* @s1 seq_cst
     29 // PPC32: load atomic i32* @i1 seq_cst
     30 // PPC32: call void @__atomic_load(i32 8, i8* bitcast (i64* @ll1 to i8*)
     31 
     32 // PPC64: define void @test1
     33 // PPC64: load atomic i8* @c1 seq_cst
     34 // PPC64: load atomic i16* @s1 seq_cst
     35 // PPC64: load atomic i32* @i1 seq_cst
     36 // PPC64: load atomic i64* @ll1 seq_cst
     37 
     38 // MIPS32: define void @test1
     39 // MIPS32: load atomic i8* @c1 seq_cst
     40 // MIPS32: load atomic i16* @s1 seq_cst
     41 // MIPS32: load atomic i32* @i1 seq_cst
     42 // MIPS32: call void @__atomic_load(i32 8, i8* bitcast (i64* @ll1 to i8*)
     43 
     44 // MIPS64: define void @test1
     45 // MIPS64: load atomic i8* @c1 seq_cst
     46 // MIPS64: load atomic i16* @s1 seq_cst
     47 // MIPS64: load atomic i32* @i1 seq_cst
     48 // MIPS64: load atomic i64* @ll1 seq_cst
     49 }
     50