Skip to content

Commit 4581169

Browse files
committed
[clang][CodeGen] Added llvm ir pre-commit test.
1 parent 77913b5 commit 4581169

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %clang_cc1 -triple riscv64 -O1 -emit-llvm %s -o - | FileCheck %s
2+
#include <stdbool.h>
3+
4+
extern bool t1;
5+
bool test1(void) {
6+
// CHECK-LABEL: define{{.*}} i1 @test1
7+
// CHECK: load atomic i8, ptr @t1 monotonic, align 1
8+
// CHECK-NEXT: trunc i8 %{{.*}} to i1
9+
// CHECK-NEXT: ret i1 %{{.*}}
10+
return __atomic_load_n(&t1, __ATOMIC_RELAXED);
11+
}

0 commit comments

Comments
 (0)