From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGenCXX/assign-operator.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 clang/test/CodeGenCXX/assign-operator.cpp (limited to 'clang/test/CodeGenCXX/assign-operator.cpp') diff --git a/clang/test/CodeGenCXX/assign-operator.cpp b/clang/test/CodeGenCXX/assign-operator.cpp new file mode 100644 index 0000000..e19df27 --- /dev/null +++ b/clang/test/CodeGenCXX/assign-operator.cpp @@ -0,0 +1,30 @@ +// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -emit-llvm -verify -o - |FileCheck %s + +class x { +public: int operator=(int); +}; +void a() { + x a; + a = 1u; +} + +void f(int i, int j) { + // CHECK: load i32 + // CHECK: load i32 + // CHECK: add nsw i32 + // CHECK: store i32 + // CHECK: store i32 17, i32 + // CHECK: ret + (i += j) = 17; +} + +// Taken from g++.old-deja/g++.jason/net.C +namespace test1 { + template void fn (T t) { } + template struct A { + void (*p)(T); + A() { p = fn; } + }; + + A a; +} -- cgit v1.2.3