• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -sink < %s | FileCheck %s
2target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
3target triple = "x86_64-unknown-linux-gnu"
4
5define void @test1(i32* ()*) {
6entry:
7  %1 = call i32* %0() #0
8  fence syncscope("singlethread") seq_cst
9  %2 = load i32, i32* %1, align 4
10  fence syncscope("singlethread") seq_cst
11  %3 = icmp eq i32 %2, 0
12  br i1 %3, label %fail, label %pass
13
14fail:                                             ; preds = %top
15  br label %pass
16
17pass:                                             ; preds = %fail, %top
18  ret void
19}
20
21; CHECK-LABEL: @test1(
22; CHECK:  %[[call:.*]] = call i32* %0()
23; CHECK:  fence syncscope("singlethread") seq_cst
24; CHECK:  load i32, i32* %[[call]], align 4
25; CHECK:  fence syncscope("singlethread") seq_cst
26
27
28attributes #0 = { nounwind readnone }
29