[PATCH] D121441: [PowerPC][NFC] Add atomic alignments and ops tests for powerpc

Kai Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 10 22:40:45 PST 2022


lkail updated this revision to Diff 414583.
lkail added a comment.

Add `-verify`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121441/new/

https://reviews.llvm.org/D121441

Files:
  clang/test/CodeGen/PowerPC/atomic-alignment.c
  clang/test/Sema/atomic-ops.c


Index: clang/test/Sema/atomic-ops.c
===================================================================
--- clang/test/Sema/atomic-ops.c
+++ clang/test/Sema/atomic-ops.c
@@ -4,6 +4,8 @@
 // RUN:   -fsyntax-only -triple=i686-linux-android -std=c11
 // RUN: %clang_cc1 %s -verify -fgnuc-version=4.2.1 -ffreestanding \
 // RUN:   -fsyntax-only -triple=powerpc64-linux-gnu -std=c11
+// RUN: %clang_cc1 %s -verify -fgnuc-version=4.2.1 -ffreestanding \
+// RUN:   -fsyntax-only -triple=powerpc64le-linux-gnu -std=c11
 
 // Basic parsing/Sema tests for __c11_atomic_*
 
Index: clang/test/CodeGen/PowerPC/atomic-alignment.c
===================================================================
--- /dev/null
+++ clang/test/CodeGen/PowerPC/atomic-alignment.c
@@ -0,0 +1,38 @@
+// REQUIRES: powerpc-registered-target
+// RUN: %clang_cc1 -verify -triple powerpc-unkonwn-unknown -emit-llvm -o - %s | \
+// RUN:   FileCheck %s --check-prefixes=PPC,PPC32
+// RUN: %clang_cc1 -verify -triple powerpc64le-unkonwn-linux -emit-llvm -o - %s | \
+// RUN:   FileCheck %s --check-prefixes=PPC,PPC64
+// RUN: %clang_cc1 -verify -triple powerpc64-unkonwn-aix -emit-llvm -o - %s | \
+// RUN:   FileCheck %s --check-prefixes=PPC,PPC64
+
+// PPC: @c = global i8 0, align 1{{$}}
+_Atomic(char) c; // expected-no-diagnostics
+
+// PPC: @s = global i16 0, align 2{{$}}
+_Atomic(short) s; // expected-no-diagnostics
+
+// PPC: @i = global i32 0, align 4{{$}}
+_Atomic(int) i; // expected-no-diagnostics
+
+// PPC32: @l = global i32 0, align 4{{$}}
+// PPC64: @l = global i64 0, align 8{{$}}
+_Atomic(long) l; // expected-no-diagnostics
+
+// PPC: @ll = global i64 0, align 8{{$}}
+_Atomic(long long) ll; // expected-no-diagnostics
+
+typedef struct {
+  char x[8];
+} O;
+
+// PPC32: @o = global %struct.O zeroinitializer, align 1{{$}}
+// PPC64: @o = global %struct.O zeroinitializer, align 8{{$}}
+_Atomic(O) o; // expected-no-diagnostics
+
+typedef struct {
+  char x[16];
+} Q;
+
+// PPC: @q = global %struct.Q zeroinitializer, align 1{{$}}
+_Atomic(Q) q; // expected-no-diagnostics


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121441.414583.patch
Type: text/x-patch
Size: 2054 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220311/f052256d/attachment.bin>


More information about the cfe-commits mailing list