Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / pr9614.c
blob394af32fd6cb3946010ad9b4f654bcbba1555f00
1 // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s
3 extern void foo_alias (void) __asm ("foo");
4 inline void foo (void) {
5 return foo_alias ();
7 extern int abs_alias (int) __asm ("abs");
8 inline __attribute__ ((__always_inline__)) int abs (int x) {
9 return abs_alias(x);
11 extern char *strrchr_foo (const char *__s, int __c) __asm ("strrchr");
12 extern inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strrchr_foo (const char *__s, int __c) {
13 return __builtin_strrchr (__s, __c);
16 extern inline void __attribute__((always_inline, __gnu_inline__))
17 prefetch(void) {
18 __builtin_prefetch(0, 0, 1);
21 extern inline __attribute__((__always_inline__, __gnu_inline__)) void *memchr(void *__s, int __c, __SIZE_TYPE__ __n) {
22 return __builtin_memchr(__s, __c, __n);
25 void f(void) {
26 foo();
27 abs(0);
28 strrchr_foo("", '.');
29 prefetch();
30 memchr("", '.', 0);
33 // CHECK-LABEL: define{{.*}} void @f()
34 // CHECK: call void @foo()
35 // CHECK: call i32 @abs(i32 noundef %0)
36 // CHECK: call ptr @strrchr(
37 // CHECK: call void @llvm.prefetch.p0(
38 // CHECK: call ptr @memchr(
39 // CHECK: ret void
41 // CHECK: declare void @foo()
42 // CHECK: declare i32 @abs(i32
43 // CHECK: declare ptr @strrchr(ptr noundef, i32 noundef)
44 // CHECK: declare ptr @memchr(
45 // CHECK: declare void @llvm.prefetch.p0(