Files
clang-p2996/clang/test/CodeGen/pr45476.cpp
Huihui Zhang fd842d3626 [CodeGen][NFC] Fix test/CodeGen/pr45476.cpp to specify target triple.
Summary:
Use explicit target triple to match more accurately the output for libcall
or native atomic.

Similar to D74847, without explicit target triple, this test will fail for ARM.

This patch update test pr45476.cpp to check for both native atomic and libcall.

Reviewers: efriedma, ekatz, rjmccall, rsmith, luismarques

Reviewed By: efriedma

Subscribers: kristof.beyls, jfb, cfe-commits, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D79914
2020-05-13 18:04:14 -07:00

23 lines
542 B
C++

// RUN: %clang_cc1 -triple arm-unknown-linux-gnueabi -emit-llvm %s -o - | FileCheck -check-prefix=LIBCALL %s
// RUN: %clang_cc1 -triple armv8-eabi -emit-llvm %s -o - | FileCheck -check-prefix=NATIVE %s
// PR45476
// This test used to get into an infinite loop,
// which, in turn, caused clang to never finish execution.
struct s3 {
char a, b, c;
};
_Atomic struct s3 a;
extern "C" void foo() {
// LIBCALL-LABEL: @foo
// LIBCALL: call void @__atomic_store
// NATIVE-LABEL: @foo
// NATIVE: store atomic i32
a = s3{1, 2, 3};
}